From b3e1a0b5fe364bdfaba04850396a2798839ef72e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 14 Apr 2025 21:22:33 +0000 Subject: [PATCH] CodeGen from PR 33466 in Azure/azure-rest-api-specs Merge 62fc5e0e0a054e0830794e05f7938d1e61dad88a into ee2c80925c383e8efc4853837ef3adb56dcd6fea --- .../Sample_AutonomousDBVersionCollection.cs | 8 +- .../Sample_AutonomousDBVersionResource.cs | 2 +- ...mple_AutonomousDatabaseBackupCollection.cs | 56 +- ...Sample_AutonomousDatabaseBackupResource.cs | 12 +- ...utonomousDatabaseCharacterSetCollection.cs | 8 +- ..._AutonomousDatabaseCharacterSetResource.cs | 2 +- .../Sample_AutonomousDatabaseCollection.cs | 71 +- ...sDatabaseNationalCharacterSetCollection.cs | 8 +- ...ousDatabaseNationalCharacterSetResource.cs | 2 +- .../Sample_AutonomousDatabaseResource.cs | 96 +- ...le_CloudExadataInfrastructureCollection.cs | 10 +- ...mple_CloudExadataInfrastructureResource.cs | 8 +- .../Sample_CloudVmClusterCollection.cs | 10 +- .../Sample_CloudVmClusterDBNodeCollection.cs | 10 +- .../Sample_CloudVmClusterDBNodeResource.cs | 6 +- .../Samples/Sample_CloudVmClusterResource.cs | 12 +- ...mClusterVirtualNetworkAddressCollection.cs | 12 +- ...dVmClusterVirtualNetworkAddressResource.cs | 6 +- .../Sample_ExadbVmClusterCollection.cs | 234 ++ .../Samples/Sample_ExadbVmClusterResource.cs | 150 ++ .../Sample_ExascaleDBNodeCollection.cs | 160 ++ .../Samples/Sample_ExascaleDBNodeResource.cs | 79 + ...Sample_ExascaleDBStorageVaultCollection.cs | 206 ++ .../Sample_ExascaleDBStorageVaultResource.cs | 113 + .../Samples/Sample_FlexComponentCollection.cs | 159 ++ .../Samples/Sample_FlexComponentResource.cs | 48 + .../Sample_GiMinorVersionCollection.cs | 162 ++ .../Samples/Sample_GiMinorVersionResource.cs | 49 + .../Sample_OracleDBServerCollection.cs | 10 +- .../Samples/Sample_OracleDBServerResource.cs | 2 +- .../Sample_OracleDBSystemShapeCollection.cs | 8 +- .../Sample_OracleDBSystemShapeResource.cs | 2 +- .../Sample_OracleDnsPrivateViewCollection.cs | 8 +- .../Sample_OracleDnsPrivateViewResource.cs | 2 +- .../Sample_OracleDnsPrivateZoneCollection.cs | 8 +- .../Sample_OracleDnsPrivateZoneResource.cs | 2 +- .../Sample_OracleGIVersionCollection.cs | 253 +- .../Samples/Sample_OracleGIVersionResource.cs | 62 +- .../Sample_OracleSubscriptionResource.cs | 39 +- .../Sample_OracleSystemVersionCollection.cs | 16 +- .../Sample_OracleSystemVersionResource.cs | 4 +- .../Sample_SubscriptionResourceExtensions.cs | 68 +- .../ArmOracleDatabaseModelFactory.cs | 1217 ++++++++- .../AutonomousDBVersionCollection.cs | 20 +- .../Generated/AutonomousDBVersionResource.cs | 4 +- .../AutonomousDatabaseBackupCollection.cs | 32 +- .../AutonomousDatabaseBackupResource.cs | 12 +- ...utonomousDatabaseCharacterSetCollection.cs | 20 +- .../AutonomousDatabaseCharacterSetResource.cs | 4 +- .../Generated/AutonomousDatabaseCollection.cs | 20 +- .../src/Generated/AutonomousDatabaseData.cs | 4 +- ...sDatabaseNationalCharacterSetCollection.cs | 20 +- ...ousDatabaseNationalCharacterSetResource.cs | 4 +- .../Generated/AutonomousDatabaseResource.cs | 140 +- .../CloudExadataInfrastructureCollection.cs | 20 +- .../CloudExadataInfrastructureResource.cs | 32 +- .../src/Generated/CloudVmClusterCollection.cs | 20 +- .../CloudVmClusterDBNodeCollection.cs | 28 +- .../Generated/CloudVmClusterDBNodeResource.cs | 8 +- .../src/Generated/CloudVmClusterResource.cs | 44 +- ...mClusterVirtualNetworkAddressCollection.cs | 32 +- ...dVmClusterVirtualNetworkAddressResource.cs | 12 +- .../src/Generated/ExadbVmClusterCollection.cs | 494 ++++ .../ExadbVmClusterData.Serialization.cs | 204 ++ .../src/Generated/ExadbVmClusterData.cs | 88 + .../ExadbVmClusterResource.Serialization.cs | 26 + .../src/Generated/ExadbVmClusterResource.cs | 868 +++++++ .../src/Generated/ExascaleDBNodeCollection.cs | 395 +++ .../ExascaleDBNodeData.Serialization.cs | 155 ++ .../src/Generated/ExascaleDBNodeData.cs | 75 + .../ExascaleDBNodeResource.Serialization.cs | 26 + .../src/Generated/ExascaleDBNodeResource.cs | 264 ++ .../ExascaleDBStorageVaultCollection.cs | 494 ++++ ...xascaleDBStorageVaultData.Serialization.cs | 204 ++ .../Generated/ExascaleDBStorageVaultData.cs | 88 + ...aleDBStorageVaultResource.Serialization.cs | 26 + .../ExascaleDBStorageVaultResource.cs | 707 +++++ .../MockableOracleDatabaseArmClient.cs | 60 + ...ableOracleDatabaseResourceGroupResource.cs | 150 +- ...kableOracleDatabaseSubscriptionResource.cs | 244 +- .../Extensions/OracleDatabaseExtensions.cs | 577 ++++- .../src/Generated/FlexComponentCollection.cs | 402 +++ .../FlexComponentData.Serialization.cs | 155 ++ .../src/Generated/FlexComponentData.cs | 75 + .../FlexComponentResource.Serialization.cs | 26 + .../src/Generated/FlexComponentResource.cs | 171 ++ .../src/Generated/GiMinorVersionCollection.cs | 400 +++ .../GiMinorVersionData.Serialization.cs | 155 ++ .../src/Generated/GiMinorVersionData.cs | 75 + .../GiMinorVersionResource.Serialization.cs | 26 + .../src/Generated/GiMinorVersionResource.cs | 171 ++ .../DBActionResponseOperationSource.cs | 30 + .../ExadbVmClusterOperationSource.cs | 36 + .../ExascaleDBStorageVaultOperationSource.cs | 36 + .../Models/AddSubscriptionOperationState.cs | 54 + ...nomousDBVersionProperties.Serialization.cs | 17 +- .../Models/AutonomousDBVersionProperties.cs | 15 +- ...mousDatabaseActionContent.Serialization.cs | 24 +- .../Models/AutonomousDatabaseActionContent.cs | 14 +- ...nomousDatabaseBackupPatch.Serialization.cs | 59 +- .../Models/AutonomousDatabaseBackupPatch.cs | 29 +- .../AutonomousDatabaseBackupProperties.cs | 4 +- ...ousDatabaseBaseProperties.Serialization.cs | 12 + .../AutonomousDatabaseBaseProperties.cs | 20 +- ...aseCharacterSetProperties.Serialization.cs | 7 +- ...utonomousDatabaseCharacterSetProperties.cs | 5 +- ...usDatabaseCloneProperties.Serialization.cs | 22 + .../AutonomousDatabaseCloneProperties.cs | 14 +- ...isasterRecoveryProperties.Serialization.cs | 1001 ++++++++ ...seCrossRegionDisasterRecoveryProperties.cs | 145 ++ ...sRegionDisasterRecoveryPropertiesSource.cs | 48 + ...BackupTimestampProperties.Serialization.cs | 993 ++++++++ ...usDatabaseFromBackupTimestampProperties.cs | 141 + ...baseFromBackupTimestampPropertiesSource.cs | 48 + ...nalCharacterSetProperties.Serialization.cs | 7 +- ...sDatabaseNationalCharacterSetProperties.cs | 5 +- .../Models/AutonomousDatabasePatch.cs | 4 +- ...onomousDatabaseProperties.Serialization.cs | 22 + .../Models/AutonomousDatabaseProperties.cs | 8 +- .../AutonomousDatabaseUpdateProperties.cs | 4 +- .../AzureSubscriptions.Serialization.cs | 136 + .../Generated/Models/AzureSubscriptions.cs | 76 + .../Models/CloudExadataInfrastructurePatch.cs | 4 +- ...aInfrastructureProperties.Serialization.cs | 66 + .../CloudExadataInfrastructureProperties.cs | 19 +- ...VmClusterDBNodeProperties.Serialization.cs | 85 +- .../Models/CloudVmClusterDBNodeProperties.cs | 59 +- .../Generated/Models/CloudVmClusterPatch.cs | 4 +- .../CloudVmClusterProperties.Serialization.cs | 42 + .../Models/CloudVmClusterProperties.cs | 11 +- ...VmClusterUpdateProperties.Serialization.cs | 26 + .../Models/CloudVmClusterUpdateProperties.cs | 7 +- .../Models/DBActionResponse.Serialization.cs | 133 + .../src/Generated/Models/DBActionResponse.cs | 65 + .../Models/DBNodeDetails.Serialization.cs | 126 + .../src/Generated/Models/DBNodeDetails.cs | 76 + ...edFileSystemConfiguration.Serialization.cs | 174 ++ .../Models/DefinedFileSystemConfiguration.cs | 77 + ...overyConfigurationDetails.Serialization.cs | 178 ++ .../DisasterRecoveryConfigurationDetails.cs | 77 + .../Models/ExadbVmClusterLifecycleState.cs | 66 + .../ExadbVmClusterListResult.Serialization.cs | 151 ++ .../Models/ExadbVmClusterListResult.cs | 80 + .../ExadbVmClusterPatch.Serialization.cs | 184 ++ .../Generated/Models/ExadbVmClusterPatch.cs | 86 + .../ExadbVmClusterProperties.Serialization.cs | 738 ++++++ .../Models/ExadbVmClusterProperties.cs | 297 +++ ...dbVmClusterStorageDetails.Serialization.cs | 126 + .../Models/ExadbVmClusterStorageDetails.cs | 72 + ...VmClusterUpdateProperties.Serialization.cs | 133 + .../Models/ExadbVmClusterUpdateProperties.cs | 65 + .../ExascaleDBNodeListResult.Serialization.cs | 151 ++ .../Models/ExascaleDBNodeListResult.cs | 80 + .../ExascaleDBNodeProperties.Serialization.cs | 304 +++ .../Models/ExascaleDBNodeProperties.cs | 124 + .../ExascaleDBStorageDetails.Serialization.cs | 148 ++ .../Models/ExascaleDBStorageDetails.cs | 69 + ...caleDBStorageInputDetails.Serialization.cs | 126 + .../Models/ExascaleDBStorageInputDetails.cs | 72 + .../ExascaleDBStorageVaultLifecycleState.cs | 63 + ...eDBStorageVaultListResult.Serialization.cs | 151 ++ .../ExascaleDBStorageVaultListResult.cs | 80 + ...ascaleDBStorageVaultPatch.Serialization.cs | 144 ++ .../Models/ExascaleDBStorageVaultPatch.cs | 66 + ...eDBStorageVaultProperties.Serialization.cs | 285 +++ .../ExascaleDBStorageVaultProperties.cs | 133 + ...ystemConfigurationDetails.Serialization.cs | 144 ++ .../Models/FileSystemConfigurationDetails.cs | 69 + .../FlexComponentListResult.Serialization.cs | 151 ++ .../Models/FlexComponentListResult.cs | 80 + .../FlexComponentProperties.Serialization.cs | 267 ++ .../Models/FlexComponentProperties.cs | 101 + .../GiMinorVersionListResult.Serialization.cs | 151 ++ .../Models/GiMinorVersionListResult.cs | 80 + .../GiMinorVersionProperties.Serialization.cs | 141 + .../Models/GiMinorVersionProperties.cs | 80 + .../src/Generated/Models/GridImageType.cs | 51 + .../src/Generated/Models/HardwareType.cs | 51 + .../OracleDBServerProperties.Serialization.cs | 16 + .../Models/OracleDBServerProperties.cs | 6 +- ...leDBSystemShapeProperties.Serialization.cs | 98 +- .../Models/OracleDBSystemShapeProperties.cs | 65 +- .../Generated/Models/OracleDataBaseType.cs | 6 + ...eDnsPrivateViewProperties.Serialization.cs | 55 +- .../Models/OracleDnsPrivateViewProperties.cs | 27 +- ...eDnsPrivateZoneProperties.Serialization.cs | 64 +- .../Models/OracleDnsPrivateZoneProperties.cs | 29 +- ...OracleGIVersionProperties.Serialization.cs | 7 +- .../Models/OracleGIVersionProperties.cs | 5 +- .../Models/OracleSubscriptionPatch.cs | 4 +- ...cleSubscriptionProperties.Serialization.cs | 54 + .../Models/OracleSubscriptionProperties.cs | 15 +- ...leSystemVersionProperties.Serialization.cs | 7 +- .../Models/OracleSystemVersionProperties.cs | 5 +- ...FromExadbVmClusterDetails.Serialization.cs | 136 + ...VirtualMachineFromExadbVmClusterDetails.cs | 76 + .../src/Generated/Models/ShapeFamily.cs | 51 + .../src/Generated/Models/SystemShape.cs | 54 + ...ousDatabaseBaseProperties.Serialization.cs | 22 + ...UnknownAutonomousDatabaseBaseProperties.cs | 8 +- .../src/Generated/OracleDBServerCollection.cs | 28 +- .../src/Generated/OracleDBServerResource.cs | 4 +- .../OracleDBSystemShapeCollection.cs | 34 +- .../Generated/OracleDBSystemShapeResource.cs | 4 +- .../OracleDnsPrivateViewCollection.cs | 20 +- .../Generated/OracleDnsPrivateViewResource.cs | 4 +- .../OracleDnsPrivateZoneCollection.cs | 20 +- .../Generated/OracleDnsPrivateZoneResource.cs | 4 +- .../Generated/OracleGIVersionCollection.cs | 37 +- .../src/Generated/OracleGIVersionResource.cs | 73 +- .../Generated/OracleSubscriptionResource.cs | 120 +- .../OracleSystemVersionCollection.cs | 20 +- .../Generated/OracleSystemVersionResource.cs | 4 +- ...AutonomousDatabaseBackupsRestOperations.cs | 26 +- ...mousDatabaseCharacterSetsRestOperations.cs | 10 +- ...baseNationalCharacterSetsRestOperations.cs | 10 +- ...utonomousDatabaseVersionsRestOperations.cs | 10 +- .../AutonomousDatabasesRestOperations.cs | 96 +- ...oudExadataInfrastructuresRestOperations.cs | 2 +- .../CloudVmClustersRestOperations.cs | 2 +- .../RestOperations/DbNodesRestOperations.cs | 26 +- .../RestOperations/DbServersRestOperations.cs | 26 +- .../DbSystemShapesRestOperations.cs | 46 +- .../DnsPrivateViewsRestOperations.cs | 10 +- .../DnsPrivateZonesRestOperations.cs | 10 +- .../ExadbVmClustersRestOperations.cs | 817 ++++++ .../ExascaleDbNodesRestOperations.cs | 423 +++ .../ExascaleDbStorageVaultsRestOperations.cs | 723 ++++++ .../FlexComponentsRestOperations.cs | 307 +++ .../GiMinorVersionsRestOperations.cs | 339 +++ .../GiVersionsRestOperations.cs | 58 +- .../OracleSubscriptionsRestOperations.cs | 78 +- .../SystemVersionsRestOperations.cs | 10 +- .../VirtualNetworkAddressesRestOperations.cs | 26 +- .../src/autorest.md | 2 +- .../Azure.ResourceManager.OracleDatabase.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 80 + .../assets.json | 7 + ...ourceManager.OracleDatabase.Samples.csproj | 13 + ...Sample_AutonomousDatabaseBackupResource.cs | 51 + .../Sample_AutonomousDatabaseResource.cs | 188 ++ ...mple_CloudExadataInfrastructureResource.cs | 49 + .../Samples/Sample_CloudVmClusterResource.cs | 113 + .../Samples/Sample_DbNodeResource.cs | 52 + .../Samples/Sample_DbSystemShapeCollection.cs | 54 + .../Samples/Sample_ExadbVmClusterResource.cs | 54 + .../Sample_ExascaleDbNodeCollection.cs | 54 + .../Samples/Sample_ExascaleDbNodeResource.cs | 48 + ...Sample_ExascaleDbStorageVaultCollection.cs | 206 ++ .../Sample_ExascaleDbStorageVaultResource.cs | 113 + .../Samples/Sample_FlexComponentCollection.cs | 159 ++ .../Samples/Sample_FlexComponentResource.cs | 48 + .../Sample_GiMinorVersionCollection.cs | 162 ++ .../Samples/Sample_GiMinorVersionResource.cs | 49 + .../Samples/Sample_GiVersionCollection.cs | 91 + .../Sample_OracleSubscriptionResource.cs | 146 ++ .../Sample_SubscriptionResourceExtensions.cs | 50 + ...zure.ResourceManager.OracleDatabase.csproj | 8 + .../ArmOracleDatabaseModelFactory.cs | 2267 +++++++++++++++++ .../AutonomousDatabaseBackupCollection.cs | 493 ++++ ...onomousDatabaseBackupData.Serialization.cs | 155 ++ .../Generated/AutonomousDatabaseBackupData.cs | 75 + ...ousDatabaseBackupResource.Serialization.cs | 26 + .../AutonomousDatabaseBackupResource.cs | 347 +++ ...utonomousDatabaseCharacterSetCollection.cs | 399 +++ ...sDatabaseCharacterSetData.Serialization.cs | 155 ++ .../AutonomousDatabaseCharacterSetData.cs | 80 + ...abaseCharacterSetResource.Serialization.cs | 26 + .../AutonomousDatabaseCharacterSetResource.cs | 171 ++ .../Generated/AutonomousDatabaseCollection.cs | 494 ++++ .../AutonomousDatabaseData.Serialization.cs | 178 ++ .../src/Generated/AutonomousDatabaseData.cs | 91 + ...sDatabaseNationalCharacterSetCollection.cs | 399 +++ ...eNationalCharacterSetData.Serialization.cs | 155 ++ ...onomousDatabaseNationalCharacterSetData.cs | 80 + ...ionalCharacterSetResource.Serialization.cs | 26 + ...ousDatabaseNationalCharacterSetResource.cs | 171 ++ ...utonomousDatabaseResource.Serialization.cs | 26 + .../Generated/AutonomousDatabaseResource.cs | 1312 ++++++++++ .../AutonomousDbVersionCollection.cs | 399 +++ .../AutonomousDbVersionData.Serialization.cs | 155 ++ .../src/Generated/AutonomousDbVersionData.cs | 75 + ...tonomousDbVersionResource.Serialization.cs | 26 + .../Generated/AutonomousDbVersionResource.cs | 171 ++ .../CloudExadataInfrastructureCollection.cs | 494 ++++ ...ExadataInfrastructureData.Serialization.cs | 197 ++ .../CloudExadataInfrastructureData.cs | 93 + ...ataInfrastructureResource.Serialization.cs | 26 + .../CloudExadataInfrastructureResource.cs | 860 +++++++ .../src/Generated/CloudVmClusterCollection.cs | 494 ++++ .../CloudVmClusterData.Serialization.cs | 178 ++ .../src/Generated/CloudVmClusterData.cs | 83 + .../CloudVmClusterResource.Serialization.cs | 26 + .../src/Generated/CloudVmClusterResource.cs | 1096 ++++++++ .../src/Generated/DbNodeCollection.cs | 395 +++ .../src/Generated/DbNodeData.Serialization.cs | 155 ++ .../src/Generated/DbNodeData.cs | 75 + .../Generated/DbNodeResource.Serialization.cs | 26 + .../src/Generated/DbNodeResource.cs | 264 ++ .../src/Generated/DbServerCollection.cs | 395 +++ .../Generated/DbServerData.Serialization.cs | 155 ++ .../src/Generated/DbServerData.cs | 75 + .../DbServerResource.Serialization.cs | 26 + .../src/Generated/DbServerResource.cs | 171 ++ .../src/Generated/DbSystemShapeCollection.cs | 401 +++ .../DbSystemShapeData.Serialization.cs | 155 ++ .../src/Generated/DbSystemShapeData.cs | 75 + .../DbSystemShapeResource.Serialization.cs | 26 + .../src/Generated/DbSystemShapeResource.cs | 171 ++ .../src/Generated/DnsPrivateViewCollection.cs | 399 +++ .../DnsPrivateViewData.Serialization.cs | 155 ++ .../src/Generated/DnsPrivateViewData.cs | 75 + .../DnsPrivateViewResource.Serialization.cs | 26 + .../src/Generated/DnsPrivateViewResource.cs | 171 ++ .../src/Generated/DnsPrivateZoneCollection.cs | 399 +++ .../DnsPrivateZoneData.Serialization.cs | 155 ++ .../src/Generated/DnsPrivateZoneData.cs | 75 + .../DnsPrivateZoneResource.Serialization.cs | 26 + .../src/Generated/DnsPrivateZoneResource.cs | 171 ++ .../src/Generated/ExadbVmClusterCollection.cs | 494 ++++ .../ExadbVmClusterData.Serialization.cs | 204 ++ .../src/Generated/ExadbVmClusterData.cs | 88 + .../ExadbVmClusterResource.Serialization.cs | 26 + .../src/Generated/ExadbVmClusterResource.cs | 868 +++++++ .../src/Generated/ExascaleDbNodeCollection.cs | 395 +++ .../ExascaleDbNodeData.Serialization.cs | 155 ++ .../src/Generated/ExascaleDbNodeData.cs | 75 + .../ExascaleDbNodeResource.Serialization.cs | 26 + .../src/Generated/ExascaleDbNodeResource.cs | 264 ++ .../ExascaleDbStorageVaultCollection.cs | 494 ++++ ...xascaleDbStorageVaultData.Serialization.cs | 204 ++ .../Generated/ExascaleDbStorageVaultData.cs | 88 + ...aleDbStorageVaultResource.Serialization.cs | 26 + .../ExascaleDbStorageVaultResource.cs | 707 +++++ .../MockableOracleDatabaseArmClient.cs | 289 +++ ...ableOracleDatabaseResourceGroupResource.cs | 381 +++ ...kableOracleDatabaseSubscriptionResource.cs | 1015 ++++++++ .../Extensions/OracleDatabaseExtensions.cs | 2140 ++++++++++++++++ .../src/Generated/FlexComponentCollection.cs | 402 +++ .../FlexComponentData.Serialization.cs | 155 ++ .../src/Generated/FlexComponentData.cs | 75 + .../FlexComponentResource.Serialization.cs | 26 + .../src/Generated/FlexComponentResource.cs | 171 ++ .../src/Generated/GiMinorVersionCollection.cs | 400 +++ .../GiMinorVersionData.Serialization.cs | 155 ++ .../src/Generated/GiMinorVersionData.cs | 75 + .../GiMinorVersionResource.Serialization.cs | 26 + .../src/Generated/GiMinorVersionResource.cs | 171 ++ .../src/Generated/GiVersionCollection.cs | 404 +++ .../Generated/GiVersionData.Serialization.cs | 155 ++ .../src/Generated/GiVersionData.cs | 80 + .../GiVersionResource.Serialization.cs | 26 + .../src/Generated/GiVersionResource.cs | 240 ++ .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 ++ .../Generated/Internal/ChangeTrackingList.cs | 153 ++ .../Internal/ModelSerializationExtensions.cs | 399 +++ .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + ...AutonomousDatabaseBackupOperationSource.cs | 36 + .../AutonomousDatabaseOperationSource.cs | 36 + ...oudExadataInfrastructureOperationSource.cs | 36 + .../CloudVmClusterOperationSource.cs | 36 + .../DbActionResponseOperationSource.cs | 30 + .../DbNodeOperationSource.cs | 36 + .../ExadbVmClusterOperationSource.cs | 36 + .../ExascaleDbStorageVaultOperationSource.cs | 36 + .../OracleDatabaseArmOperation.cs | 94 + .../OracleDatabaseArmOperationOfT.cs | 100 + .../OracleSubscriptionOperationSource.cs | 36 + .../VirtualNetworkAddressOperationSource.cs | 36 + .../Models/AddRemoveDbNode.Serialization.cs | 136 + .../src/Generated/Models/AddRemoveDbNode.cs | 76 + .../Models/AddSubscriptionOperationState.cs | 54 + .../AllConnectionStringType.Serialization.cs | 151 ++ .../Models/AllConnectionStringType.cs | 73 + .../Models/ApexDetailsType.Serialization.cs | 140 + .../src/Generated/Models/ApexDetailsType.cs} | 24 +- .../AutonomousDatabaseBackupLifecycleState.cs | 60 + ...sDatabaseBackupListResult.Serialization.cs | 151 ++ .../AutonomousDatabaseBackupListResult.cs | 80 + ...sDatabaseBackupProperties.Serialization.cs | 347 +++ .../AutonomousDatabaseBackupProperties.cs | 125 + .../Models/AutonomousDatabaseBackupType.cs | 54 + ...ousDatabaseBaseProperties.Serialization.cs | 530 ++++ .../AutonomousDatabaseBaseProperties.cs | 380 +++ ...aseCharacterSetListResult.Serialization.cs | 151 ++ ...utonomousDatabaseCharacterSetListResult.cs | 80 + ...seCharacterSetProperties.Serialization.cs} | 55 +- ...utonomousDatabaseCharacterSetProperties.cs | 75 + ...usDatabaseCloneProperties.Serialization.cs | 1000 ++++++++ .../AutonomousDatabaseCloneProperties.cs | 152 ++ ...isasterRecoveryProperties.Serialization.cs | 957 +++++++ ...seCrossRegionDisasterRecoveryProperties.cs | 145 ++ ...BackupTimestampProperties.Serialization.cs | 949 +++++++ ...usDatabaseFromBackupTimestampProperties.cs | 141 + .../AutonomousDatabaseLifecycleState.cs | 108 + ...onomousDatabaseListResult.Serialization.cs | 151 ++ .../Models/AutonomousDatabaseListResult.cs | 80 + ...nalCharacterSetListResult.Serialization.cs | 151 ++ ...sDatabaseNationalCharacterSetListResult.cs | 80 + ...nalCharacterSetProperties.Serialization.cs | 126 + ...sDatabaseNationalCharacterSetProperties.cs | 75 + .../AutonomousDatabasePatch.Serialization.cs | 159 ++ .../Models/AutonomousDatabasePatch.cs | 70 + ...onomousDatabaseProperties.Serialization.cs | 890 +++++++ .../Models/AutonomousDatabaseProperties.cs | 107 + ...ousDatabaseStandbySummary.Serialization.cs | 187 ++ .../AutonomousDatabaseStandbySummary.cs | 81 + ...sDatabaseUpdateProperties.Serialization.cs | 495 ++++ .../AutonomousDatabaseUpdateProperties.cs | 155 ++ ...onomousDatabaseWalletFile.Serialization.cs | 126 + .../Models/AutonomousDatabaseWalletFile.cs | 75 + ...nomousDbVersionListResult.Serialization.cs | 151 ++ .../Models/AutonomousDbVersionListResult.cs | 80 + ...nomousDbVersionProperties.Serialization.cs | 208 ++ .../Models/AutonomousDbVersionProperties.cs | 95 + .../AutonomousMaintenanceScheduleType.cs | 51 + .../Models/AzureResourceProvisioningState.cs | 57 + .../AzureSubscriptions.Serialization.cs | 136 + .../Generated/Models/AzureSubscriptions.cs | 76 + .../src/Generated/Models/CloneType.cs | 51 + .../Models/CloudAccountProvisioningState.cs | 54 + ...loudExadataInfrastructureLifecycleState.cs | 66 + ...aInfrastructureListResult.Serialization.cs | 151 ++ .../CloudExadataInfrastructureListResult.cs | 80 + ...xadataInfrastructurePatch.Serialization.cs | 184 ++ .../Models/CloudExadataInfrastructurePatch.cs | 75 + ...aInfrastructureProperties.Serialization.cs | 641 +++++ .../CloudExadataInfrastructureProperties.cs | 216 ++ ...structureUpdateProperties.Serialization.cs | 205 ++ ...udExadataInfrastructureUpdateProperties.cs | 82 + .../Models/CloudVmClusterLifecycleState.cs | 66 + .../CloudVmClusterListResult.Serialization.cs | 151 ++ .../Models/CloudVmClusterListResult.cs | 80 + .../CloudVmClusterPatch.Serialization.cs | 159 ++ .../Generated/Models/CloudVmClusterPatch.cs | 70 + .../CloudVmClusterProperties.Serialization.cs | 877 +++++++ .../Models/CloudVmClusterProperties.cs | 299 +++ ...VmClusterUpdateProperties.Serialization.cs | 337 +++ .../Models/CloudVmClusterUpdateProperties.cs | 112 + .../src/Generated/Models/ComputeModel.cs | 51 + .../ConnectionStringType.Serialization.cs | 209 ++ .../Generated/Models/ConnectionStringType.cs | 86 + .../Models/ConnectionUrlType.Serialization.cs | 203 ++ .../src/Generated/Models/ConnectionUrlType.cs | 89 + .../src/Generated/Models/ConsumerGroup.cs | 60 + .../Models/CustomerContact.Serialization.cs | 126 + .../src/Generated/Models/CustomerContact.cs | 75 + .../src/Generated/Models/DataBaseType.cs | 57 + .../DataCollectionOptions.Serialization.cs | 163 ++ .../Generated/Models/DataCollectionOptions.cs | 73 + .../Generated/Models/DataSafeStatusType.cs | 60 + .../Generated/Models/DatabaseEditionType.cs | 51 + .../Models/DayOfWeek.Serialization.cs | 126 + .../src/Generated/Models/DayOfWeek.cs | 72 + .../src/Generated/Models/DayOfWeekName.cs | 66 + .../Models/DbActionResponse.Serialization.cs | 133 + .../src/Generated/Models/DbActionResponse.cs | 65 + .../Models/DbIormConfig.Serialization.cs | 155 ++ .../src/Generated/Models/DbIormConfig.cs | 73 + .../Models/DbNodeAction.Serialization.cs | 126 + .../src/Generated/Models/DbNodeAction.cs | 72 + .../src/Generated/Models/DbNodeActionEnum.cs | 57 + .../Models/DbNodeDetails.Serialization.cs | 126 + .../src/Generated/Models/DbNodeDetails.cs | 76 + .../Models/DbNodeListResult.Serialization.cs | 151 ++ .../src/Generated/Models/DbNodeListResult.cs | 80 + .../Generated/Models/DbNodeMaintenanceType.cs | 48 + .../Models/DbNodeProperties.Serialization.cs | 412 +++ .../src/Generated/Models/DbNodeProperties.cs | 173 ++ .../Models/DbNodeProvisioningState.cs | 72 + .../DbServerListResult.Serialization.cs | 151 ++ .../Generated/Models/DbServerListResult.cs | 80 + .../DbServerPatchingDetails.Serialization.cs | 178 ++ .../Models/DbServerPatchingDetails.cs | 77 + .../Models/DbServerPatchingStatus.cs | 57 + .../DbServerProperties.Serialization.cs | 471 ++++ .../Generated/Models/DbServerProperties.cs | 149 ++ .../Models/DbServerProvisioningState.cs | 63 + .../DbSystemShapeListResult.Serialization.cs | 151 ++ .../Models/DbSystemShapeListResult.cs | 80 + .../DbSystemShapeProperties.Serialization.cs | 481 ++++ .../Models/DbSystemShapeProperties.cs | 169 ++ ...edFileSystemConfiguration.Serialization.cs | 174 ++ .../Models/DefinedFileSystemConfiguration.cs | 77 + ...overyConfigurationDetails.Serialization.cs | 178 ++ .../DisasterRecoveryConfigurationDetails.cs | 77 + .../Generated/Models/DisasterRecoveryType.cs | 51 + .../src/Generated/Models/DiskRedundancy.cs | 51 + .../DnsPrivateViewListResult.Serialization.cs | 151 ++ .../Models/DnsPrivateViewListResult.cs | 80 + .../DnsPrivateViewProperties.Serialization.cs | 198 ++ .../Models/DnsPrivateViewProperties.cs | 117 + .../Models/DnsPrivateViewsLifecycleState.cs | 57 + .../DnsPrivateZoneListResult.Serialization.cs | 151 ++ .../Models/DnsPrivateZoneListResult.cs | 80 + .../DnsPrivateZoneProperties.Serialization.cs | 219 ++ .../Models/DnsPrivateZoneProperties.cs | 127 + .../Models/DnsPrivateZonesLifecycleState.cs | 60 + .../EstimatedPatchingTime.Serialization.cs | 178 ++ .../Generated/Models/EstimatedPatchingTime.cs | 77 + .../Models/ExadataIormConfig.Serialization.cs | 184 ++ .../src/Generated/Models/ExadataIormConfig.cs | 78 + .../Models/ExadbVmClusterLifecycleState.cs | 66 + .../ExadbVmClusterListResult.Serialization.cs | 151 ++ .../Models/ExadbVmClusterListResult.cs | 80 + .../ExadbVmClusterPatch.Serialization.cs | 184 ++ .../Generated/Models/ExadbVmClusterPatch.cs | 86 + .../ExadbVmClusterProperties.Serialization.cs | 710 ++++++ .../Models/ExadbVmClusterProperties.cs | 297 +++ ...dbVmClusterStorageDetails.Serialization.cs | 126 + .../Models/ExadbVmClusterStorageDetails.cs | 72 + ...VmClusterUpdateProperties.Serialization.cs | 133 + .../Models/ExadbVmClusterUpdateProperties.cs | 65 + .../ExascaleDbNodeListResult.Serialization.cs | 151 ++ .../Models/ExascaleDbNodeListResult.cs | 80 + .../ExascaleDbNodeProperties.Serialization.cs | 304 +++ .../Models/ExascaleDbNodeProperties.cs | 123 + .../ExascaleDbStorageDetails.Serialization.cs | 148 ++ .../Models/ExascaleDbStorageDetails.cs | 69 + ...caleDbStorageInputDetails.Serialization.cs | 126 + .../Models/ExascaleDbStorageInputDetails.cs | 72 + .../ExascaleDbStorageVaultLifecycleState.cs | 63 + ...eDbStorageVaultListResult.Serialization.cs | 151 ++ .../ExascaleDbStorageVaultListResult.cs | 80 + ...ascaleDbStorageVaultPatch.Serialization.cs | 144 ++ .../Models/ExascaleDbStorageVaultPatch.cs | 66 + ...eDbStorageVaultProperties.Serialization.cs | 281 ++ .../ExascaleDbStorageVaultProperties.cs | 132 + ...ystemConfigurationDetails.Serialization.cs | 144 ++ .../Models/FileSystemConfigurationDetails.cs | 69 + .../FlexComponentListResult.Serialization.cs | 151 ++ .../Models/FlexComponentListResult.cs | 80 + .../FlexComponentProperties.Serialization.cs | 267 ++ .../Models/FlexComponentProperties.cs | 101 + ...mousDatabaseWalletDetails.Serialization.cs | 156 ++ ...GenerateAutonomousDatabaseWalletDetails.cs | 83 + .../src/Generated/Models/GenerateType.cs | 51 + .../GiMinorVersionListResult.Serialization.cs | 151 ++ .../Models/GiMinorVersionListResult.cs | 80 + .../GiMinorVersionProperties.Serialization.cs | 137 + .../Models/GiMinorVersionProperties.cs | 79 + .../GiVersionListResult.Serialization.cs | 151 ++ .../Generated/Models/GiVersionListResult.cs | 80 + .../GiVersionProperties.Serialization.cs | 126 + .../Generated/Models/GiVersionProperties.cs | 75 + .../src/Generated/Models/GridImageType.cs | 51 + .../src/Generated/Models/HardwareType.cs | 51 + .../src/Generated/Models/HostFormatType.cs | 51 + .../src/Generated/Models/Intent.cs | 51 + .../Generated/Models/IormLifecycleState.cs | 60 + .../src/Generated/Models/LicenseModel.cs | 51 + ...TermBackUpScheduleDetails.Serialization.cs | 178 ++ .../Models/LongTermBackUpScheduleDetails.cs | 77 + .../Models/MaintenanceWindow.Serialization.cs | 319 +++ .../src/Generated/Models/MaintenanceWindow.cs | 105 + .../Generated/Models/Month.Serialization.cs | 126 + .../src/Generated/Models/Month.cs | 72 + .../src/Generated/Models/MonthName.cs | 81 + .../Generated/Models/NsgCidr.Serialization.cs | 141 + .../src/Generated/Models/NsgCidr.cs | 79 + .../src/Generated/Models/Objective.cs | 60 + .../src/Generated/Models/OpenModeType.cs | 51 + .../Models/OperationsInsightsStatusType.cs | 63 + ...cleSubscriptionListResult.Serialization.cs | 151 ++ .../Models/OracleSubscriptionListResult.cs | 80 + .../OracleSubscriptionPatch.Serialization.cs | 149 ++ .../Models/OracleSubscriptionPatch.cs | 70 + ...cleSubscriptionProperties.Serialization.cs | 269 ++ .../Models/OracleSubscriptionProperties.cs | 102 + .../OracleSubscriptionProvisioningState.cs | 54 + ...scriptionUpdateProperties.Serialization.cs | 144 ++ .../OracleSubscriptionUpdateProperties.cs | 69 + .../src/Generated/Models/PatchingMode.cs | 51 + .../Models/PeerDbDetails.Serialization.cs | 151 ++ .../src/Generated/Models/PeerDbDetails.cs | 73 + .../Generated/Models/PermissionLevelType.cs | 51 + .../Models/PortRange.Serialization.cs | 134 + .../src/Generated/Models/PortRange.cs | 78 + .../src/Generated/Models/Preference.cs | 51 + ...rivateIPAddressProperties.Serialization.cs | 164 ++ .../Models/PrivateIPAddressProperties.cs | 103 + .../PrivateIPAddressesFilter.Serialization.cs | 134 + .../Models/PrivateIPAddressesFilter.cs | 82 + .../Models/ProfileType.Serialization.cs | 221 ++ .../src/Generated/Models/ProfileType.cs | 118 + .../src/Generated/Models/ProtocolType.cs | 51 + .../Generated/Models/RefreshableModelType.cs | 51 + .../Generated/Models/RefreshableStatusType.cs | 51 + ...FromExadbVmClusterDetails.Serialization.cs | 136 + ...VirtualMachineFromExadbVmClusterDetails.cs | 76 + .../src/Generated/Models/RepeatCadenceType.cs | 57 + .../Models/ResourceProvisioningState.cs | 54 + ...AutonomousDatabaseDetails.Serialization.cs | 126 + .../RestoreAutonomousDatabaseDetails.cs | 72 + .../src/Generated/Models/RoleType.cs | 60 + .../ScheduledOperationsType.Serialization.cs | 148 ++ .../Models/ScheduledOperationsType.cs | 93 + .../src/Generated/Models/SessionModeType.cs | 51 + .../src/Generated/Models/ShapeFamily.cs | 51 + .../src/Generated/Models/SourceType.cs | 66 + .../src/Generated/Models/SyntaxFormatType.cs | 54 + .../src/Generated/Models/SystemShape.cs | 54 + .../SystemVersionListResult.Serialization.cs | 151 ++ .../Models/SystemVersionListResult.cs | 80 + .../SystemVersionProperties.Serialization.cs | 126 + .../Models/SystemVersionProperties.cs | 75 + .../Generated/Models/TlsAuthenticationType.cs | 51 + ...ousDatabaseBaseProperties.Serialization.cs | 890 +++++++ ...UnknownAutonomousDatabaseBaseProperties.cs | 106 + .../VirtualNetworkAddressLifecycleState.cs | 60 + ...lNetworkAddressListResult.Serialization.cs | 151 ++ .../Models/VirtualNetworkAddressListResult.cs | 80 + ...lNetworkAddressProperties.Serialization.cs | 227 ++ .../Models/VirtualNetworkAddressProperties.cs | 93 + .../src/Generated/Models/WorkloadType.cs | 57 + .../src/Generated/Models/ZoneType.cs | 51 + .../OracleSubscriptionData.Serialization.cs | 171 ++ .../src/Generated/OracleSubscriptionData.cs | 79 + ...racleSubscriptionResource.Serialization.cs | 26 + .../Generated/OracleSubscriptionResource.cs | 782 ++++++ .../src/Generated/ProviderConstants.cs | 16 + ...AutonomousDatabaseBackupsRestOperations.cs | 613 +++++ ...mousDatabaseCharacterSetsRestOperations.cs | 295 +++ ...baseNationalCharacterSetsRestOperations.cs | 295 +++ ...utonomousDatabaseVersionsRestOperations.cs | 295 +++ .../AutonomousDatabasesRestOperations.cs | 1287 ++++++++++ ...oudExadataInfrastructuresRestOperations.cs | 809 ++++++ .../CloudVmClustersRestOperations.cs | 1024 ++++++++ .../RestOperations/DbNodesRestOperations.cs | 423 +++ .../RestOperations/DbServersRestOperations.cs | 321 +++ .../DbSystemShapesRestOperations.cs | 307 +++ .../DnsPrivateViewsRestOperations.cs | 295 +++ .../DnsPrivateZonesRestOperations.cs | 295 +++ .../ExadbVmClustersRestOperations.cs | 817 ++++++ .../ExascaleDbNodesRestOperations.cs | 423 +++ .../ExascaleDbStorageVaultsRestOperations.cs | 723 ++++++ .../FlexComponentsRestOperations.cs | 307 +++ .../GiMinorVersionsRestOperations.cs | 339 +++ .../GiVersionsRestOperations.cs | 319 +++ .../OracleSubscriptionsRestOperations.cs | 787 ++++++ .../SystemVersionsRestOperations.cs | 295 +++ .../VirtualNetworkAddressesRestOperations.cs | 513 ++++ .../src/Generated/SystemVersionCollection.cs | 399 +++ .../SystemVersionData.Serialization.cs | 155 ++ .../src/Generated/SystemVersionData.cs | 80 + .../SystemVersionResource.Serialization.cs | 26 + .../src/Generated/SystemVersionResource.cs | 171 ++ .../VirtualNetworkAddressCollection.cs | 493 ++++ ...VirtualNetworkAddressData.Serialization.cs | 155 ++ .../Generated/VirtualNetworkAddressData.cs | 75 + ...ualNetworkAddressResource.Serialization.cs | 26 + .../VirtualNetworkAddressResource.cs | 347 +++ .../src/Properties/AssemblyInfo.cs | 11 + ...esourceManager.OracleDatabase.Tests.csproj | 8 + .../tests/OracleDatabaseManagementTestBase.cs | 45 + ...OracleDatabaseManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 5 + sdk/oracledatabase/ci.mgmt.yml | 26 + sdk/resourcemanager/ci.mgmt.yml | 2 + sdk/storage/ci.yml | 2 + 664 files changed, 102321 insertions(+), 1125 deletions(-) create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExadbVmClusterCollection.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExadbVmClusterResource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBNodeCollection.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBNodeResource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBStorageVaultCollection.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBStorageVaultResource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentCollection.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentResource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionCollection.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionResource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterCollection.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeCollection.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeData.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeData.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeResource.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeResource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultCollection.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultData.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultData.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultResource.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultResource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentCollection.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionCollection.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/DBActionResponseOperationSource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExadbVmClusterOperationSource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExascaleDBStorageVaultOperationSource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddSubscriptionOperationState.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampPropertiesSource.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBActionResponse.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBActionResponse.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBNodeDetails.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBNodeDetails.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterLifecycleState.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeListResult.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeListResult.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeProperties.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeProperties.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageDetails.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageDetails.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageInputDetails.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageInputDetails.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultLifecycleState.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultListResult.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultListResult.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultPatch.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultPatch.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultProperties.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultProperties.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GridImageType.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/HardwareType.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.Serialization.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ShapeFamily.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemShape.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExadbVmClustersRestOperations.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbNodesRestOperations.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbStorageVaultsRestOperations.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/FlexComponentsRestOperations.cs create mode 100644 sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiMinorVersionsRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/Azure.ResourceManager.OracleDatabase.sln create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/CHANGELOG.md create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/Directory.Build.props create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/README.md create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/assets.json create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Azure.ResourceManager.OracleDatabase.Samples.csproj create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseBackupResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudExadataInfrastructureResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_DbNodeResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_DbSystemShapeCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExadbVmClusterResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbNodeCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbNodeResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbStorageVaultCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbStorageVaultResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiVersionCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSubscriptionResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Azure.ResourceManager.OracleDatabase.csproj create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ArmOracleDatabaseModelFactory.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseArmClient.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseResourceGroupResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseSubscriptionResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/OracleDatabaseExtensions.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/Argument.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/Optional.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/AutonomousDatabaseBackupOperationSource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/AutonomousDatabaseOperationSource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/CloudExadataInfrastructureOperationSource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/CloudVmClusterOperationSource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/DbActionResponseOperationSource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/DbNodeOperationSource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExadbVmClusterOperationSource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExascaleDbStorageVaultOperationSource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/OracleDatabaseArmOperation.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/OracleDatabaseArmOperationOfT.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/OracleSubscriptionOperationSource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/VirtualNetworkAddressOperationSource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddRemoveDbNode.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddRemoveDbNode.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddSubscriptionOperationState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AllConnectionStringType.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AllConnectionStringType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ApexDetailsType.Serialization.cs rename sdk/{oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupUpdateProperties.cs => oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ApexDetailsType.cs} (69%) create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupLifecycleState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetListResult.cs rename sdk/{oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupUpdateProperties.Serialization.cs => oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.Serialization.cs} (64%) create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseLifecycleState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabasePatch.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabasePatch.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseStandbySummary.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseStandbySummary.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseUpdateProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseUpdateProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseWalletFile.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseWalletFile.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousMaintenanceScheduleType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureResourceProvisioningState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloneType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudAccountProvisioningState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureLifecycleState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructurePatch.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructurePatch.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureUpdateProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureUpdateProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterLifecycleState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterPatch.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterPatch.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ComputeModel.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionStringType.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionStringType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionUrlType.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionUrlType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConsumerGroup.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CustomerContact.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CustomerContact.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataBaseType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataCollectionOptions.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataCollectionOptions.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataSafeStatusType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DatabaseEditionType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DayOfWeek.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DayOfWeek.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DayOfWeekName.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbActionResponse.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbActionResponse.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbIormConfig.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbIormConfig.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeAction.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeAction.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeActionEnum.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeDetails.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeDetails.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeMaintenanceType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeProvisioningState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerPatchingDetails.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerPatchingDetails.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerPatchingStatus.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerProvisioningState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DiskRedundancy.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewsLifecycleState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZonesLifecycleState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/EstimatedPatchingTime.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/EstimatedPatchingTime.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadataIormConfig.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadataIormConfig.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterLifecycleState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageDetails.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageDetails.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageInputDetails.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageInputDetails.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultLifecycleState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultPatch.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultPatch.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GenerateAutonomousDatabaseWalletDetails.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GenerateAutonomousDatabaseWalletDetails.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GenerateType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GridImageType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/HardwareType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/HostFormatType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Intent.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/IormLifecycleState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/LicenseModel.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/LongTermBackUpScheduleDetails.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/LongTermBackUpScheduleDetails.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/MaintenanceWindow.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/MaintenanceWindow.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Month.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Month.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/MonthName.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/NsgCidr.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/NsgCidr.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Objective.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OpenModeType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OperationsInsightsStatusType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionPatch.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionPatch.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProvisioningState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionUpdateProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionUpdateProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PatchingMode.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PeerDbDetails.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PeerDbDetails.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PermissionLevelType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PortRange.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PortRange.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Preference.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressesFilter.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressesFilter.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ProfileType.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ProfileType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ProtocolType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RefreshableModelType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RefreshableStatusType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RepeatCadenceType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ResourceProvisioningState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RestoreAutonomousDatabaseDetails.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RestoreAutonomousDatabaseDetails.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RoleType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ScheduledOperationsType.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ScheduledOperationsType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SessionModeType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ShapeFamily.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SourceType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SyntaxFormatType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemShape.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/TlsAuthenticationType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressLifecycleState.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressListResult.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressListResult.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressProperties.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressProperties.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/WorkloadType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ZoneType.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ProviderConstants.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseBackupsRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseCharacterSetsRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseNationalCharacterSetsRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseVersionsRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabasesRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudExadataInfrastructuresRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudVmClustersRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbNodesRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbServersRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbSystemShapesRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateViewsRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateZonesRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExadbVmClustersRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbNodesRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbStorageVaultsRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/FlexComponentsRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiMinorVersionsRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiVersionsRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/OracleSubscriptionsRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/SystemVersionsRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/VirtualNetworkAddressesRestOperations.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressCollection.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressData.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressData.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressResource.Serialization.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressResource.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Properties/AssemblyInfo.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tests/Azure.ResourceManager.OracleDatabase.Tests.csproj create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tests/OracleDatabaseManagementTestBase.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tests/OracleDatabaseManagementTestEnvironment.cs create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tsp-location.yaml create mode 100644 sdk/oracledatabase/ci.mgmt.yml diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDBVersionCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDBVersionCollection.cs index df91b65929ec..0a50b1f47a8a 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDBVersionCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDBVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_AutonomousDBVersionCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetAnAutonomousVersion() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseVersion_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseVersion_get.json // this example is just showing the usage of "AutonomousDatabaseVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetAnAutonomousVersion() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAnAutonomousVersionsByLocation() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseVersion_listByLocation.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseVersion_listByLocation.json // this example is just showing the usage of "AutonomousDatabaseVersions_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task GetAll_ListAnAutonomousVersionsByLocation() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAnAutonomousVersion() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseVersion_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseVersion_get.json // this example is just showing the usage of "AutonomousDatabaseVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Exists_GetAnAutonomousVersion() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAnAutonomousVersion() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseVersion_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseVersion_get.json // this example is just showing the usage of "AutonomousDatabaseVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDBVersionResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDBVersionResource.cs index 93d42fbf71b9..811be4f5e220 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDBVersionResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDBVersionResource.cs @@ -19,7 +19,7 @@ public partial class Sample_AutonomousDBVersionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAnAutonomousVersion() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseVersion_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseVersion_get.json // this example is just showing the usage of "AutonomousDatabaseVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseBackupCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseBackupCollection.cs index e432c8e9a7b7..2ccff4c82fde 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseBackupCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseBackupCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_AutonomousDatabaseBackupCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_AutonomousDatabaseBackupsCreateOrUpdate() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_create.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_create.json // this example is just showing the usage of "AutonomousDatabaseBackups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_AutonomousDatabaseBackupsCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAutonomousDatabaseBackup() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_create.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_create.json // this example is just showing the usage of "AutonomousDatabaseBackups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,7 +106,7 @@ public async Task CreateOrUpdate_CreateAutonomousDatabaseBackup() [Ignore("Only validating compilation of examples")] public async Task Get_AutonomousDatabaseBackupsGet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_get.json // this example is just showing the usage of "AutonomousDatabaseBackups_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 @@ -140,7 +140,7 @@ public async Task Get_AutonomousDatabaseBackupsGet() [Ignore("Only validating compilation of examples")] public async Task Get_GetAutonomousDatabaseBackup() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_get.json // this example is just showing the usage of "AutonomousDatabaseBackups_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 @@ -170,48 +170,12 @@ public async Task Get_GetAutonomousDatabaseBackup() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetAll_AutonomousDatabaseBackupsListByAutonomousDatabase() - { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_listByParent.json - // this example is just showing the usage of "AutonomousDatabaseBackups_ListByAutonomousDatabase" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details 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 AutonomousDatabaseResource created on azure - // for more information of creating AutonomousDatabaseResource, please refer to the document of AutonomousDatabaseResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "rg000"; - string autonomousdatabasename = "databasedb1"; - ResourceIdentifier autonomousDatabaseResourceId = AutonomousDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, autonomousdatabasename); - AutonomousDatabaseResource autonomousDatabase = client.GetAutonomousDatabaseResource(autonomousDatabaseResourceId); - - // get the collection of this AutonomousDatabaseBackupResource - AutonomousDatabaseBackupCollection collection = autonomousDatabase.GetAutonomousDatabaseBackups(); - - // invoke the operation and iterate over the result - await foreach (AutonomousDatabaseBackupResource 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 - AutonomousDatabaseBackupData 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 GetAll_ListAutonomousDatabaseBackupsByAutonomousDatabase() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_listByParent.json - // this example is just showing the usage of "AutonomousDatabaseBackups_ListByAutonomousDatabase" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_listByParent.json + // this example is just showing the usage of "AutonomousDatabaseBackups_ListByParent" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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(); @@ -246,7 +210,7 @@ public async Task GetAll_ListAutonomousDatabaseBackupsByAutonomousDatabase() [Ignore("Only validating compilation of examples")] public async Task Exists_AutonomousDatabaseBackupsGet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_get.json // this example is just showing the usage of "AutonomousDatabaseBackups_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 @@ -276,7 +240,7 @@ public async Task Exists_AutonomousDatabaseBackupsGet() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAutonomousDatabaseBackup() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_get.json // this example is just showing the usage of "AutonomousDatabaseBackups_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 @@ -306,7 +270,7 @@ public async Task Exists_GetAutonomousDatabaseBackup() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_AutonomousDatabaseBackupsGet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_get.json // this example is just showing the usage of "AutonomousDatabaseBackups_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 @@ -348,7 +312,7 @@ public async Task GetIfExists_AutonomousDatabaseBackupsGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAutonomousDatabaseBackup() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_get.json // this example is just showing the usage of "AutonomousDatabaseBackups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseBackupResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseBackupResource.cs index 7c8abf776248..e8cfc1a78e21 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseBackupResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseBackupResource.cs @@ -20,7 +20,7 @@ public partial class Sample_AutonomousDatabaseBackupResource [Ignore("Only validating compilation of examples")] public async Task Get_AutonomousDatabaseBackupsGet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_get.json // this example is just showing the usage of "AutonomousDatabaseBackups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_AutonomousDatabaseBackupsGet() [Ignore("Only validating compilation of examples")] public async Task Get_GetAutonomousDatabaseBackup() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_get.json // this example is just showing the usage of "AutonomousDatabaseBackups_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 @@ -82,7 +82,7 @@ public async Task Get_GetAutonomousDatabaseBackup() [Ignore("Only validating compilation of examples")] public async Task Delete_AutonomousDatabaseBackupsDelete() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_delete.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_delete.json // this example is just showing the usage of "AutonomousDatabaseBackups_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 @@ -109,7 +109,7 @@ public async Task Delete_AutonomousDatabaseBackupsDelete() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAutonomousDatabaseBackup() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_delete.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_delete.json // this example is just showing the usage of "AutonomousDatabaseBackups_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 @@ -136,7 +136,7 @@ public async Task Delete_DeleteAutonomousDatabaseBackup() [Ignore("Only validating compilation of examples")] public async Task Update_AutonomousDatabaseBackupsUpdate() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_patch.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_patch.json // this example is just showing the usage of "AutonomousDatabaseBackups_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 @@ -169,7 +169,7 @@ public async Task Update_AutonomousDatabaseBackupsUpdate() [Ignore("Only validating compilation of examples")] public async Task Update_PatchAutonomousDatabaseBackup() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseBackup_patch.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseBackup_patch.json // this example is just showing the usage of "AutonomousDatabaseBackups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseCharacterSetCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseCharacterSetCollection.cs index 1a919c543c08..af3d60022657 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseCharacterSetCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseCharacterSetCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_AutonomousDatabaseCharacterSetCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetAutonomousDbCharacterSet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseCharacterSet_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseCharacterSet_get.json // this example is just showing the usage of "AutonomousDatabaseCharacterSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetAutonomousDbCharacterSet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAutonomousDbCharacterSetsByLocation() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseCharacterSet_listByLocation.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseCharacterSet_listByLocation.json // this example is just showing the usage of "AutonomousDatabaseCharacterSets_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task GetAll_ListAutonomousDbCharacterSetsByLocation() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAutonomousDbCharacterSet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseCharacterSet_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseCharacterSet_get.json // this example is just showing the usage of "AutonomousDatabaseCharacterSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Exists_GetAutonomousDbCharacterSet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAutonomousDbCharacterSet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseCharacterSet_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseCharacterSet_get.json // this example is just showing the usage of "AutonomousDatabaseCharacterSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseCharacterSetResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseCharacterSetResource.cs index 6aab022ca5e2..201c4080dede 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseCharacterSetResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseCharacterSetResource.cs @@ -19,7 +19,7 @@ public partial class Sample_AutonomousDatabaseCharacterSetResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAutonomousDbCharacterSet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseCharacterSet_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseCharacterSet_get.json // this example is just showing the usage of "AutonomousDatabaseCharacterSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseCollection.cs index 1f2c1fd27351..89ccecc9d916 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_AutonomousDatabaseCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_AutonomousDatabasesCreateOrUpdate() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_create.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_create.json // this example is just showing the usage of "AutonomousDatabases_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -71,11 +71,60 @@ public async Task CreateOrUpdate_AutonomousDatabasesCreateOrUpdate() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_AutonomousDatabasesCreateOrUpdateCrossRegionPeer() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseCrossRegionPeer_create.json + // this example is just showing the usage of "AutonomousDatabases_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg000"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AutonomousDatabaseResource + AutonomousDatabaseCollection collection = resourceGroupResource.GetAutonomousDatabases(); + + // invoke the operation + string autonomousdatabasename = "databasedb1"; + AutonomousDatabaseData data = new AutonomousDatabaseData(new AzureLocation("eastus")) + { + Properties = new AutonomousDatabaseCrossRegionDisasterRecoveryProperties(new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Oracle.Database/autonomousDatabases/databasedb1"), DisasterRecoveryType.Adg) + { + SourceLocation = "germanywestcentral", + SourceOcid = "ocid1..aaaaa", + IsReplicateAutomaticBackups = false, + SubnetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + VnetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), + }, + Tags = +{ +["tagK1"] = "tagV1" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, autonomousdatabasename, data); + AutonomousDatabaseResource 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 + AutonomousDatabaseData 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 CreateOrUpdate_AutonomousDatabasesCreateOrUpdateClone() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseClone_create.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseClone_create.json // this example is just showing the usage of "AutonomousDatabases_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +177,7 @@ public async Task CreateOrUpdate_AutonomousDatabasesCreateOrUpdateClone() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAutonomousDatabase() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_create.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_create.json // this example is just showing the usage of "AutonomousDatabases_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -182,7 +231,7 @@ public async Task CreateOrUpdate_CreateAutonomousDatabase() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateCloneAutonomousDatabase() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseClone_create.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseClone_create.json // this example is just showing the usage of "AutonomousDatabases_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -235,7 +284,7 @@ public async Task CreateOrUpdate_CreateCloneAutonomousDatabase() [Ignore("Only validating compilation of examples")] public async Task Get_AutonomousDatabasesGet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_get.json // this example is just showing the usage of "AutonomousDatabases_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 @@ -268,7 +317,7 @@ public async Task Get_AutonomousDatabasesGet() [Ignore("Only validating compilation of examples")] public async Task Get_GetAutonomousDatabase() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_get.json // this example is just showing the usage of "AutonomousDatabases_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 @@ -301,7 +350,7 @@ public async Task Get_GetAutonomousDatabase() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAutonomousDatabaseByResourceGroup() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_listByResourceGroup.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_listByResourceGroup.json // this example is just showing the usage of "AutonomousDatabases_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -336,7 +385,7 @@ public async Task GetAll_ListAutonomousDatabaseByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_AutonomousDatabasesGet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_get.json // this example is just showing the usage of "AutonomousDatabases_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 @@ -365,7 +414,7 @@ public async Task Exists_AutonomousDatabasesGet() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAutonomousDatabase() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_get.json // this example is just showing the usage of "AutonomousDatabases_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 @@ -394,7 +443,7 @@ public async Task Exists_GetAutonomousDatabase() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_AutonomousDatabasesGet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_get.json // this example is just showing the usage of "AutonomousDatabases_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 @@ -435,7 +484,7 @@ public async Task GetIfExists_AutonomousDatabasesGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAutonomousDatabase() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_get.json // this example is just showing the usage of "AutonomousDatabases_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseNationalCharacterSetCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseNationalCharacterSetCollection.cs index 1af02f84b336..8bed2768b4fb 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseNationalCharacterSetCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseNationalCharacterSetCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_AutonomousDatabaseNationalCharacterSetCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetAutonomousDbNationalCharacterSet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseNationalCharacterSet_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseNationalCharacterSet_get.json // this example is just showing the usage of "AutonomousDatabaseNationalCharacterSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetAutonomousDbNationalCharacterSet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAutonomousDbNationalCharacterSetsByLocation() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseNationalCharacterSet_listByLocation.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseNationalCharacterSet_listByLocation.json // this example is just showing the usage of "AutonomousDatabaseNationalCharacterSets_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task GetAll_ListAutonomousDbNationalCharacterSetsByLocation() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAutonomousDbNationalCharacterSet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseNationalCharacterSet_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseNationalCharacterSet_get.json // this example is just showing the usage of "AutonomousDatabaseNationalCharacterSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Exists_GetAutonomousDbNationalCharacterSet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAutonomousDbNationalCharacterSet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseNationalCharacterSet_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseNationalCharacterSet_get.json // this example is just showing the usage of "AutonomousDatabaseNationalCharacterSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseNationalCharacterSetResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseNationalCharacterSetResource.cs index 94f4b756aa34..52f30630e9a0 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseNationalCharacterSetResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseNationalCharacterSetResource.cs @@ -19,7 +19,7 @@ public partial class Sample_AutonomousDatabaseNationalCharacterSetResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAutonomousDbNationalCharacterSet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabaseNationalCharacterSet_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabaseNationalCharacterSet_get.json // this example is just showing the usage of "AutonomousDatabaseNationalCharacterSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseResource.cs index 35c1cdf0dc91..feadd8207b20 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseResource.cs @@ -20,7 +20,7 @@ public partial class Sample_AutonomousDatabaseResource [Ignore("Only validating compilation of examples")] public async Task Get_AutonomousDatabasesGet() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_get.json // this example is just showing the usage of "AutonomousDatabases_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 @@ -50,7 +50,7 @@ public async Task Get_AutonomousDatabasesGet() [Ignore("Only validating compilation of examples")] public async Task Get_GetAutonomousDatabase() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_get.json // this example is just showing the usage of "AutonomousDatabases_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 @@ -80,7 +80,7 @@ public async Task Get_GetAutonomousDatabase() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAutonomousDatabase() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_delete.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_delete.json // this example is just showing the usage of "AutonomousDatabases_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 @@ -106,7 +106,7 @@ public async Task Delete_DeleteAutonomousDatabase() [Ignore("Only validating compilation of examples")] public async Task Update_PatchAutonomousDatabase() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_patch.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_patch.json // this example is just showing the usage of "AutonomousDatabases_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 @@ -134,11 +134,83 @@ public async Task Update_PatchAutonomousDatabase() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task ChangeDisasterRecoveryConfiguration_AutonomousDatabasesChangeDisasterRecoveryConfiguration() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_changeDisasterRecoveryConfiguration.json + // this example is just showing the usage of "AutonomousDatabases_ChangeDisasterRecoveryConfiguration" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 AutonomousDatabaseResource created on azure + // for more information of creating AutonomousDatabaseResource, please refer to the document of AutonomousDatabaseResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg000"; + string autonomousdatabasename = "databasedb1"; + ResourceIdentifier autonomousDatabaseResourceId = AutonomousDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, autonomousdatabasename); + AutonomousDatabaseResource autonomousDatabase = client.GetAutonomousDatabaseResource(autonomousDatabaseResourceId); + + // invoke the operation + DisasterRecoveryConfigurationDetails details = new DisasterRecoveryConfigurationDetails + { + DisasterRecoveryType = DisasterRecoveryType.Adg, + IsReplicateAutomaticBackups = false, + }; + ArmOperation lro = await autonomousDatabase.ChangeDisasterRecoveryConfigurationAsync(WaitUntil.Completed, details); + AutonomousDatabaseResource 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 + AutonomousDatabaseData 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 ChangeDisasterRecoveryConfiguration_PerformChangeDisasterRecoveryConfigurationActionOnAutonomousDatabase() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_changeDisasterRecoveryConfiguration.json + // this example is just showing the usage of "AutonomousDatabases_ChangeDisasterRecoveryConfiguration" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 AutonomousDatabaseResource created on azure + // for more information of creating AutonomousDatabaseResource, please refer to the document of AutonomousDatabaseResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg000"; + string autonomousdatabasename = "databasedb1"; + ResourceIdentifier autonomousDatabaseResourceId = AutonomousDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, autonomousdatabasename); + AutonomousDatabaseResource autonomousDatabase = client.GetAutonomousDatabaseResource(autonomousDatabaseResourceId); + + // invoke the operation + DisasterRecoveryConfigurationDetails details = new DisasterRecoveryConfigurationDetails + { + DisasterRecoveryType = DisasterRecoveryType.Adg, + IsReplicateAutomaticBackups = false, + }; + ArmOperation lro = await autonomousDatabase.ChangeDisasterRecoveryConfigurationAsync(WaitUntil.Completed, details); + AutonomousDatabaseResource 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 + AutonomousDatabaseData 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 Failover_AutonomousDatabasesFailover() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_failover.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_failover.json // this example is just showing the usage of "AutonomousDatabases_Failover" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +245,7 @@ public async Task Failover_AutonomousDatabasesFailover() [Ignore("Only validating compilation of examples")] public async Task Failover_PerformFailoverActionOnAutonomousDatabase() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_failover.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_failover.json // this example is just showing the usage of "AutonomousDatabases_Failover" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -208,7 +280,7 @@ public async Task Failover_PerformFailoverActionOnAutonomousDatabase() [Ignore("Only validating compilation of examples")] public async Task GenerateWallet_GenerateWalletActionOnAutonomousDatabase() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_generateWallet.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_generateWallet.json // this example is just showing the usage of "AutonomousDatabases_GenerateWallet" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -239,7 +311,7 @@ public async Task GenerateWallet_GenerateWalletActionOnAutonomousDatabase() [Ignore("Only validating compilation of examples")] public async Task Restore_AutonomousDatabasesRestore() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_restore.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_restore.json // this example is just showing the usage of "AutonomousDatabases_Restore" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -271,7 +343,7 @@ public async Task Restore_AutonomousDatabasesRestore() [Ignore("Only validating compilation of examples")] public async Task Restore_PerformRestoreActionOnAutonomousDatabase() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_restore.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_restore.json // this example is just showing the usage of "AutonomousDatabases_Restore" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -303,7 +375,7 @@ public async Task Restore_PerformRestoreActionOnAutonomousDatabase() [Ignore("Only validating compilation of examples")] public async Task Shrink_PerformShrinkActionOnAutonomousDatabase() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_shrink.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_shrink.json // this example is just showing the usage of "AutonomousDatabases_Shrink" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -334,7 +406,7 @@ public async Task Shrink_PerformShrinkActionOnAutonomousDatabase() [Ignore("Only validating compilation of examples")] public async Task Switchover_AutonomousDatabasesSwitchover() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_switchover.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_switchover.json // this example is just showing the usage of "AutonomousDatabases_Switchover" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -369,7 +441,7 @@ public async Task Switchover_AutonomousDatabasesSwitchover() [Ignore("Only validating compilation of examples")] public async Task Switchover_PerformSwitchoverActionOnAutonomousDatabase() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_switchover.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_switchover.json // this example is just showing the usage of "AutonomousDatabases_Switchover" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudExadataInfrastructureCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudExadataInfrastructureCollection.cs index 0b49b074b022..9085c97e9280 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudExadataInfrastructureCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudExadataInfrastructureCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_CloudExadataInfrastructureCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateExadataInfrastructure() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_create.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_create.json // this example is just showing the usage of "CloudExadataInfrastructures_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -67,7 +67,7 @@ public async Task CreateOrUpdate_CreateExadataInfrastructure() [Ignore("Only validating compilation of examples")] public async Task Get_GetExadataInfrastructure() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_get.json // this example is just showing the usage of "CloudExadataInfrastructures_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task Get_GetExadataInfrastructure() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListExadataInfrastructureByResourceGroup() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_listByResourceGroup.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_listByResourceGroup.json // this example is just showing the usage of "CloudExadataInfrastructures_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +135,7 @@ public async Task GetAll_ListExadataInfrastructureByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetExadataInfrastructure() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_get.json // this example is just showing the usage of "CloudExadataInfrastructures_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 @@ -164,7 +164,7 @@ public async Task Exists_GetExadataInfrastructure() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetExadataInfrastructure() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_get.json // this example is just showing the usage of "CloudExadataInfrastructures_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudExadataInfrastructureResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudExadataInfrastructureResource.cs index 6d729811d7a6..9204ffec9ea9 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudExadataInfrastructureResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudExadataInfrastructureResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CloudExadataInfrastructureResource [Ignore("Only validating compilation of examples")] public async Task Get_GetExadataInfrastructure() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_get.json // this example is just showing the usage of "CloudExadataInfrastructures_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 @@ -50,7 +50,7 @@ public async Task Get_GetExadataInfrastructure() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteExadataInfrastructure() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_delete.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_delete.json // this example is just showing the usage of "CloudExadataInfrastructures_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 @@ -76,7 +76,7 @@ public async Task Delete_DeleteExadataInfrastructure() [Ignore("Only validating compilation of examples")] public async Task Update_PatchExadataInfrastructure() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_patch.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_patch.json // this example is just showing the usage of "CloudExadataInfrastructures_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 @@ -108,7 +108,7 @@ public async Task Update_PatchExadataInfrastructure() [Ignore("Only validating compilation of examples")] public async Task AddStorageCapacity_PerformAddStorageCapacityOnExadataInfra() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_addStorageCapacity.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_addStorageCapacity.json // this example is just showing the usage of "CloudExadataInfrastructures_AddStorageCapacity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterCollection.cs index ecdf28d949a1..0eee5734b043 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_CloudVmClusterCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateVMCluster() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_create.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_create.json // this example is just showing the usage of "CloudVmClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task CreateOrUpdate_CreateVMCluster() [Ignore("Only validating compilation of examples")] public async Task Get_GetVMCluster() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_get.json // this example is just showing the usage of "CloudVmClusters_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 @@ -131,7 +131,7 @@ public async Task Get_GetVMCluster() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListVMClustersByResourceGroup() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listByResourceGroup.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_listByResourceGroup.json // this example is just showing the usage of "CloudVmClusters_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetAll_ListVMClustersByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetVMCluster() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_get.json // this example is just showing the usage of "CloudVmClusters_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 @@ -195,7 +195,7 @@ public async Task Exists_GetVMCluster() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetVMCluster() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_get.json // this example is just showing the usage of "CloudVmClusters_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterDBNodeCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterDBNodeCollection.cs index e5e5c24a0e90..af03fcfa0a52 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterDBNodeCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterDBNodeCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_CloudVmClusterDBNodeCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetDbNode() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbNodes_get.json // this example is just showing the usage of "DbNodes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,8 +53,8 @@ public async Task Get_GetDbNode() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListDbNodesByVMCluster() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_listByParent.json - // this example is just showing the usage of "DbNodes_ListByCloudVmCluster" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbNodes_listByParent.json + // this example is just showing the usage of "DbNodes_ListByParent" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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(); @@ -89,7 +89,7 @@ public async Task GetAll_ListDbNodesByVMCluster() [Ignore("Only validating compilation of examples")] public async Task Exists_GetDbNode() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbNodes_get.json // this example is just showing the usage of "DbNodes_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 @@ -119,7 +119,7 @@ public async Task Exists_GetDbNode() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetDbNode() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbNodes_get.json // this example is just showing the usage of "DbNodes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterDBNodeResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterDBNodeResource.cs index 81ca799f3a6c..ffe8ca4d0b5e 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterDBNodeResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterDBNodeResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CloudVmClusterDBNodeResource [Ignore("Only validating compilation of examples")] public async Task Get_GetDbNode() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbNodes_get.json // this example is just showing the usage of "DbNodes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetDbNode() [Ignore("Only validating compilation of examples")] public async Task Action_DbNodesAction() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_action.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbNodes_action.json // this example is just showing the usage of "DbNodes_Action" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -84,7 +84,7 @@ public async Task Action_DbNodesAction() [Ignore("Only validating compilation of examples")] public async Task Action_VMActionsOnDbNodesOfVMCluster() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbNodes_action.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbNodes_action.json // this example is just showing the usage of "DbNodes_Action" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterResource.cs index 607731f20e28..e228bbb7c401 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CloudVmClusterResource [Ignore("Only validating compilation of examples")] public async Task Get_GetVMCluster() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_get.json // this example is just showing the usage of "CloudVmClusters_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 @@ -50,7 +50,7 @@ public async Task Get_GetVMCluster() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteVMCluster() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_delete.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_delete.json // this example is just showing the usage of "CloudVmClusters_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 @@ -76,7 +76,7 @@ public async Task Delete_DeleteVMCluster() [Ignore("Only validating compilation of examples")] public async Task Update_PatchVMCluster() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_patch.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_patch.json // this example is just showing the usage of "CloudVmClusters_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 @@ -108,7 +108,7 @@ public async Task Update_PatchVMCluster() [Ignore("Only validating compilation of examples")] public async Task AddVms_AddVMsToVMCluster() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_addVms.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_addVms.json // this example is just showing the usage of "CloudVmClusters_AddVms" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,7 +140,7 @@ public async Task AddVms_AddVMsToVMCluster() [Ignore("Only validating compilation of examples")] public async Task GetPrivateIPAddresses_ListPrivateIPAddressesForVMCluster() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listPrivateIpAddresses.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_listPrivateIpAddresses.json // this example is just showing the usage of "CloudVmClusters_ListPrivateIPAddresses" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task GetPrivateIPAddresses_ListPrivateIPAddressesForVMCluster() [Ignore("Only validating compilation of examples")] public async Task RemoveVms_RemoveVMsFromVMCluster() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_removeVms.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_removeVms.json // this example is just showing the usage of "CloudVmClusters_RemoveVms" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterVirtualNetworkAddressCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterVirtualNetworkAddressCollection.cs index 181e2a5cfa36..c832df9a315a 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterVirtualNetworkAddressCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterVirtualNetworkAddressCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CloudVmClusterVirtualNetworkAddressCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateVirtualNetworkAddress() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_create.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/virtualNetworkAddresses_create.json // this example is just showing the usage of "VirtualNetworkAddresses_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_CreateVirtualNetworkAddress() [Ignore("Only validating compilation of examples")] public async Task Get_GetVirtualNetworkAddress() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/virtualNetworkAddresses_get.json // this example is just showing the usage of "VirtualNetworkAddresses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,8 +97,8 @@ public async Task Get_GetVirtualNetworkAddress() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListVirtualNetworkAddressesByVMCluster() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_listByParent.json - // this example is just showing the usage of "VirtualNetworkAddresses_ListByCloudVmCluster" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/virtualNetworkAddresses_listByParent.json + // this example is just showing the usage of "VirtualNetworkAddresses_ListByParent" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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(); @@ -133,7 +133,7 @@ public async Task GetAll_ListVirtualNetworkAddressesByVMCluster() [Ignore("Only validating compilation of examples")] public async Task Exists_GetVirtualNetworkAddress() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/virtualNetworkAddresses_get.json // this example is just showing the usage of "VirtualNetworkAddresses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +163,7 @@ public async Task Exists_GetVirtualNetworkAddress() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetVirtualNetworkAddress() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/virtualNetworkAddresses_get.json // this example is just showing the usage of "VirtualNetworkAddresses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterVirtualNetworkAddressResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterVirtualNetworkAddressResource.cs index 9a1722e7c902..48b63c393c71 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterVirtualNetworkAddressResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterVirtualNetworkAddressResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CloudVmClusterVirtualNetworkAddressResource [Ignore("Only validating compilation of examples")] public async Task Get_GetVirtualNetworkAddress() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/virtualNetworkAddresses_get.json // this example is just showing the usage of "VirtualNetworkAddresses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_GetVirtualNetworkAddress() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteVirtualNetworkAddress() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_delete.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/virtualNetworkAddresses_delete.json // this example is just showing the usage of "VirtualNetworkAddresses_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_DeleteVirtualNetworkAddress() [Ignore("Only validating compilation of examples")] public async Task Update_CreateVirtualNetworkAddress() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/virtualNetworkAddresses_create.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/virtualNetworkAddresses_create.json // this example is just showing the usage of "VirtualNetworkAddresses_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExadbVmClusterCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExadbVmClusterCollection.cs new file mode 100644 index 000000000000..6ff690602467 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExadbVmClusterCollection.cs @@ -0,0 +1,234 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_ExadbVmClusterCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ExadbVmClustersCreateOrUpdateMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "ExadbVmClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExadbVmClusterResource + ExadbVmClusterCollection collection = resourceGroupResource.GetExadbVmClusters(); + + // invoke the operation + string exadbVmClusterName = "clusterName"; + ExadbVmClusterData data = new ExadbVmClusterData(new AzureLocation("xojp")) + { + Properties = new ExadbVmClusterProperties( + new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1"), + new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg000/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), + "dyhkncxzzgcwlfkfygvqlvqbxekvkbhjprmuxtaukewjnfrrnfqgrqsjfgsayrezkspqplrduuomuvtpkqurcoqjdnadlvedgfngglcgafbxtcewxlgckvehhqgfwkokbjoqftunjsgfjwbdaftxoytsphydwogtlnfxxuzzjvqcrin", + 0, + new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Oracle.Database/exascaleDbStorageVaults/storageVaultName"), + "tdn", + 8, + "evenjblxxfsztdxlcr", + new string[] { "wiseakllkohemfmnoyteg" }, + 56, + new ExadbVmClusterStorageDetails(10)) + { + ClusterName = "hssswln", + BackupSubnetCidr = "fr", + DataCollectionOptions = new DiagnosticCollectionConfig + { + IsDiagnosticsEventsEnabled = true, + IsHealthMonitoringEnabled = true, + IsIncidentLogsEnabled = true, + }, + Domain = "vzfak", + GridImageOcid = new ResourceIdentifier("ocid1.dbpatch.oc1..aaaaa3klq"), + LicenseModel = OracleLicenseModel.LicenseIncluded, + NsgCidrs = {new CloudVmClusterNsgCidr("10.0.0.0/16") +{ +DestinationPortRange = new CloudVmClusterPortRange(1520, 1522), +}}, + PrivateZoneOcid = new ResourceIdentifier("ocid1.autonomousdatabase.oc1..aaaaa3klq"), + ScanListenerPortTcp = 9, + ScanListenerPortTcpSsl = 18, + SystemVersion = "udwsykstqawwjrvzebfyyccnjzhxtijvywlgnrkqxnboibyppistnbvqqsnsxmjnzeumgnatmarzfnjhglmtrknszthrxtwewwqjbkwytbhtjbgondtktkpvjmxdcuyjupr", + TimeZone = "ayuqnpfkasdzmxlfnkjzrenyogbvcysdbkstjhyjdgxygitlykihtwdiktilukyplgxovaonrqcqaviyaqgyrqfrklqvqyobnxgmzpqbgjhdtjdquhyqnvhavnqpfupaqhdedgdvfomeueeuwjjfiqiyxspybpyj", + }, + Zones = { "iupjvcfsbvfhrebwf" }, + Tags = +{ +["key9683"] = "umnfswbmhxzsomcluslxhnxxika" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, exadbVmClusterName, data); + ExadbVmClusterResource 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 + ExadbVmClusterData 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_ExadbVmClustersGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExadbVmClusters_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExadbVmClusterResource + ExadbVmClusterCollection collection = resourceGroupResource.GetExadbVmClusters(); + + // invoke the operation + string exadbVmClusterName = "vmClusterName"; + ExadbVmClusterResource result = await collection.GetAsync(exadbVmClusterName); + + // 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 + ExadbVmClusterData 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_ExadbVmClustersListByResourceGroupMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "ExadbVmClusters_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExadbVmClusterResource + ExadbVmClusterCollection collection = resourceGroupResource.GetExadbVmClusters(); + + // invoke the operation and iterate over the result + await foreach (ExadbVmClusterResource 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 + ExadbVmClusterData 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_ExadbVmClustersGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExadbVmClusters_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExadbVmClusterResource + ExadbVmClusterCollection collection = resourceGroupResource.GetExadbVmClusters(); + + // invoke the operation + string exadbVmClusterName = "vmClusterName"; + bool result = await collection.ExistsAsync(exadbVmClusterName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ExadbVmClustersGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExadbVmClusters_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExadbVmClusterResource + ExadbVmClusterCollection collection = resourceGroupResource.GetExadbVmClusters(); + + // invoke the operation + string exadbVmClusterName = "vmClusterName"; + NullableResponse response = await collection.GetIfExistsAsync(exadbVmClusterName); + ExadbVmClusterResource 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 + ExadbVmClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExadbVmClusterResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExadbVmClusterResource.cs new file mode 100644 index 000000000000..3846f62b5249 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExadbVmClusterResource.cs @@ -0,0 +1,150 @@ +// 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.OracleDatabase.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_ExadbVmClusterResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ExadbVmClustersGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExadbVmClusters_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 ExadbVmClusterResource created on azure + // for more information of creating ExadbVmClusterResource, please refer to the document of ExadbVmClusterResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exadbVmClusterName = "vmClusterName"; + ResourceIdentifier exadbVmClusterResourceId = ExadbVmClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exadbVmClusterName); + ExadbVmClusterResource exadbVmCluster = client.GetExadbVmClusterResource(exadbVmClusterResourceId); + + // invoke the operation + ExadbVmClusterResource result = await exadbVmCluster.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 + ExadbVmClusterData 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_ExadbVmClustersDeleteMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "ExadbVmClusters_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 ExadbVmClusterResource created on azure + // for more information of creating ExadbVmClusterResource, please refer to the document of ExadbVmClusterResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exadbVmClusterName = "vmClusterName"; + ResourceIdentifier exadbVmClusterResourceId = ExadbVmClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exadbVmClusterName); + ExadbVmClusterResource exadbVmCluster = client.GetExadbVmClusterResource(exadbVmClusterResourceId); + + // invoke the operation + await exadbVmCluster.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ExadbVmClustersUpdateMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_Update_MaximumSet_Gen.json + // this example is just showing the usage of "ExadbVmClusters_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 ExadbVmClusterResource created on azure + // for more information of creating ExadbVmClusterResource, please refer to the document of ExadbVmClusterResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exadbVmClusterName = "vmClusterName"; + ResourceIdentifier exadbVmClusterResourceId = ExadbVmClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exadbVmClusterName); + ExadbVmClusterResource exadbVmCluster = client.GetExadbVmClusterResource(exadbVmClusterResourceId); + + // invoke the operation + ExadbVmClusterPatch patch = new ExadbVmClusterPatch + { + Zones = { "zcqfxmpauiqjphmhwwt" }, + Tags = +{ +["key6027"] = "kesrhztqxwjjsexr" +}, + ExadbVmClusterUpdateNodeCount = 9, + }; + ArmOperation lro = await exadbVmCluster.UpdateAsync(WaitUntil.Completed, patch); + ExadbVmClusterResource 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 + ExadbVmClusterData 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 RemoveVms_ExadbVmClustersRemoveVmsMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_RemoveVms_MaximumSet_Gen.json + // this example is just showing the usage of "ExadbVmClusters_RemoveVms" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 ExadbVmClusterResource created on azure + // for more information of creating ExadbVmClusterResource, please refer to the document of ExadbVmClusterResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exadbVmClusterName = "vmClusterName"; + ResourceIdentifier exadbVmClusterResourceId = ExadbVmClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exadbVmClusterName); + ExadbVmClusterResource exadbVmCluster = client.GetExadbVmClusterResource(exadbVmClusterResourceId); + + // invoke the operation + RemoveVirtualMachineFromExadbVmClusterDetails details = new RemoveVirtualMachineFromExadbVmClusterDetails(new DBNodeDetails[] + { +new DBNodeDetails(new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Oracle.Database/exadbVmClusters/vmCluster/dbNodes/dbNodeName")) + }); + ArmOperation lro = await exadbVmCluster.RemoveVmsAsync(WaitUntil.Completed, details); + ExadbVmClusterResource 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 + ExadbVmClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBNodeCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBNodeCollection.cs new file mode 100644 index 000000000000..e31eb6003620 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBNodeCollection.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.OracleDatabase.Samples +{ + public partial class Sample_ExascaleDBNodeCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ExascaleDbNodesGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbNodes_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbNodes_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 ExadbVmClusterResource created on azure + // for more information of creating ExadbVmClusterResource, please refer to the document of ExadbVmClusterResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exadbVmClusterName = "vmClusterName"; + ResourceIdentifier exadbVmClusterResourceId = ExadbVmClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exadbVmClusterName); + ExadbVmClusterResource exadbVmCluster = client.GetExadbVmClusterResource(exadbVmClusterResourceId); + + // get the collection of this ExascaleDBNodeResource + ExascaleDBNodeCollection collection = exadbVmCluster.GetExascaleDBNodes(); + + // invoke the operation + string exascaleDBNodeName = "dbNodeName"; + ExascaleDBNodeResource result = await collection.GetAsync(exascaleDBNodeName); + + // 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 + ExascaleDBNodeData 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_ExascaleDbNodesListByParentMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbNodes_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbNodes_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 ExadbVmClusterResource created on azure + // for more information of creating ExadbVmClusterResource, please refer to the document of ExadbVmClusterResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exadbVmClusterName = "vmClusterName"; + ResourceIdentifier exadbVmClusterResourceId = ExadbVmClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exadbVmClusterName); + ExadbVmClusterResource exadbVmCluster = client.GetExadbVmClusterResource(exadbVmClusterResourceId); + + // get the collection of this ExascaleDBNodeResource + ExascaleDBNodeCollection collection = exadbVmCluster.GetExascaleDBNodes(); + + // invoke the operation and iterate over the result + await foreach (ExascaleDBNodeResource 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 + ExascaleDBNodeData 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_ExascaleDbNodesGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbNodes_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbNodes_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 ExadbVmClusterResource created on azure + // for more information of creating ExadbVmClusterResource, please refer to the document of ExadbVmClusterResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exadbVmClusterName = "vmClusterName"; + ResourceIdentifier exadbVmClusterResourceId = ExadbVmClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exadbVmClusterName); + ExadbVmClusterResource exadbVmCluster = client.GetExadbVmClusterResource(exadbVmClusterResourceId); + + // get the collection of this ExascaleDBNodeResource + ExascaleDBNodeCollection collection = exadbVmCluster.GetExascaleDBNodes(); + + // invoke the operation + string exascaleDBNodeName = "dbNodeName"; + bool result = await collection.ExistsAsync(exascaleDBNodeName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ExascaleDbNodesGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbNodes_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbNodes_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 ExadbVmClusterResource created on azure + // for more information of creating ExadbVmClusterResource, please refer to the document of ExadbVmClusterResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exadbVmClusterName = "vmClusterName"; + ResourceIdentifier exadbVmClusterResourceId = ExadbVmClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exadbVmClusterName); + ExadbVmClusterResource exadbVmCluster = client.GetExadbVmClusterResource(exadbVmClusterResourceId); + + // get the collection of this ExascaleDBNodeResource + ExascaleDBNodeCollection collection = exadbVmCluster.GetExascaleDBNodes(); + + // invoke the operation + string exascaleDBNodeName = "dbNodeName"; + NullableResponse response = await collection.GetIfExistsAsync(exascaleDBNodeName); + ExascaleDBNodeResource 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 + ExascaleDBNodeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBNodeResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBNodeResource.cs new file mode 100644 index 000000000000..54f8db174550 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBNodeResource.cs @@ -0,0 +1,79 @@ +// 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.OracleDatabase.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_ExascaleDBNodeResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ExascaleDbNodesGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbNodes_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbNodes_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 ExascaleDBNodeResource created on azure + // for more information of creating ExascaleDBNodeResource, please refer to the document of ExascaleDBNodeResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exadbVmClusterName = "vmClusterName"; + string exascaleDBNodeName = "dbNodeName"; + ResourceIdentifier exascaleDBNodeResourceId = ExascaleDBNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exadbVmClusterName, exascaleDBNodeName); + ExascaleDBNodeResource exascaleDBNode = client.GetExascaleDBNodeResource(exascaleDBNodeResourceId); + + // invoke the operation + ExascaleDBNodeResource result = await exascaleDBNode.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 + ExascaleDBNodeData 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 Action_ExascaleDbNodesActionMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbNodes_Action_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbNodes_Action" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 ExascaleDBNodeResource created on azure + // for more information of creating ExascaleDBNodeResource, please refer to the document of ExascaleDBNodeResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exadbVmClusterName = "vmClusterName"; + string exascaleDBNodeName = "dbNodeName"; + ResourceIdentifier exascaleDBNodeResourceId = ExascaleDBNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exadbVmClusterName, exascaleDBNodeName); + ExascaleDBNodeResource exascaleDBNode = client.GetExascaleDBNodeResource(exascaleDBNodeResourceId); + + // invoke the operation + DBNodeAction body = new DBNodeAction(DBNodeActionType.Start); + ArmOperation lro = await exascaleDBNode.ActionAsync(WaitUntil.Completed, body); + DBActionResponse result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBStorageVaultCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBStorageVaultCollection.cs new file mode 100644 index 000000000000..842a5154c05b --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBStorageVaultCollection.cs @@ -0,0 +1,206 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_ExascaleDBStorageVaultCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ExascaleDbStorageVaultsCreateMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_Create_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVaults_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExascaleDBStorageVaultResource + ExascaleDBStorageVaultCollection collection = resourceGroupResource.GetExascaleDBStorageVaults(); + + // invoke the operation + string exascaleDBStorageVaultName = "vmClusterName"; + ExascaleDBStorageVaultData data = new ExascaleDBStorageVaultData(new AzureLocation("ltguhzffucaytqg")) + { + Properties = new ExascaleDBStorageVaultProperties("hbsybtelyvhpalemszcvartlhwvskrnpiveqfblvkdihoytqaotdgsgauvgivzaftfgeiwlyeqzssicwrrnlxtsmeakbcsxabjlt", new ExascaleDBStorageInputDetails(21)) + { + AdditionalFlashCacheInPercent = 0, + Description = "dmnvnnduldfmrmkkvvsdtuvmsmruxzzpsfdydgytlckutfozephjygjetrauvbdfcwmti", + TimeZone = "ltrbozwxjunncicrtzjrpqnqrcjgghohztrdlbfjrbkpenopyldwolslwgrgumjfkyovvkzcuxjujuxtjjzubvqvnhrswnbdgcbslopeofmtepbrrlymqwwszvsglmyuvlcuejshtpokirwklnwpcykhyinjmlqvxtyixlthtdishhmtipbygsayvgqzfrprgppylydlcskbmvwctxifdltippfvsxiughqbojqpqrekxsotnqsk", + }, + Zones = { "qk" }, + Tags = +{ +["key7827"] = "xqi" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, exascaleDBStorageVaultName, data); + ExascaleDBStorageVaultResource 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 + ExascaleDBStorageVaultData 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_ExascaleDbStorageVaultsGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVaults_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExascaleDBStorageVaultResource + ExascaleDBStorageVaultCollection collection = resourceGroupResource.GetExascaleDBStorageVaults(); + + // invoke the operation + string exascaleDBStorageVaultName = "vmClusterName"; + ExascaleDBStorageVaultResource result = await collection.GetAsync(exascaleDBStorageVaultName); + + // 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 + ExascaleDBStorageVaultData 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_ExascaleDbStorageVaultsListByResourceGroupMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVaults_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExascaleDBStorageVaultResource + ExascaleDBStorageVaultCollection collection = resourceGroupResource.GetExascaleDBStorageVaults(); + + // invoke the operation and iterate over the result + await foreach (ExascaleDBStorageVaultResource 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 + ExascaleDBStorageVaultData 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_ExascaleDbStorageVaultsGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVaults_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExascaleDBStorageVaultResource + ExascaleDBStorageVaultCollection collection = resourceGroupResource.GetExascaleDBStorageVaults(); + + // invoke the operation + string exascaleDBStorageVaultName = "vmClusterName"; + bool result = await collection.ExistsAsync(exascaleDBStorageVaultName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ExascaleDbStorageVaultsGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVaults_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExascaleDBStorageVaultResource + ExascaleDBStorageVaultCollection collection = resourceGroupResource.GetExascaleDBStorageVaults(); + + // invoke the operation + string exascaleDBStorageVaultName = "vmClusterName"; + NullableResponse response = await collection.GetIfExistsAsync(exascaleDBStorageVaultName); + ExascaleDBStorageVaultResource 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 + ExascaleDBStorageVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBStorageVaultResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBStorageVaultResource.cs new file mode 100644 index 000000000000..d1d0002dc0a1 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDBStorageVaultResource.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.OracleDatabase.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_ExascaleDBStorageVaultResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ExascaleDbStorageVaultsGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVaults_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 ExascaleDBStorageVaultResource created on azure + // for more information of creating ExascaleDBStorageVaultResource, please refer to the document of ExascaleDBStorageVaultResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exascaleDBStorageVaultName = "vmClusterName"; + ResourceIdentifier exascaleDBStorageVaultResourceId = ExascaleDBStorageVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exascaleDBStorageVaultName); + ExascaleDBStorageVaultResource exascaleDBStorageVault = client.GetExascaleDBStorageVaultResource(exascaleDBStorageVaultResourceId); + + // invoke the operation + ExascaleDBStorageVaultResource result = await exascaleDBStorageVault.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 + ExascaleDBStorageVaultData 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_ExascaleDbStorageVaultsDeleteMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVaults_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 ExascaleDBStorageVaultResource created on azure + // for more information of creating ExascaleDBStorageVaultResource, please refer to the document of ExascaleDBStorageVaultResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exascaleDBStorageVaultName = "vmClusterName"; + ResourceIdentifier exascaleDBStorageVaultResourceId = ExascaleDBStorageVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exascaleDBStorageVaultName); + ExascaleDBStorageVaultResource exascaleDBStorageVault = client.GetExascaleDBStorageVaultResource(exascaleDBStorageVaultResourceId); + + // invoke the operation + await exascaleDBStorageVault.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ExascaleDbStorageVaultsUpdateMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_Update_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVaults_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 ExascaleDBStorageVaultResource created on azure + // for more information of creating ExascaleDBStorageVaultResource, please refer to the document of ExascaleDBStorageVaultResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exascaleDBStorageVaultName = "vmClusterName"; + ResourceIdentifier exascaleDBStorageVaultResourceId = ExascaleDBStorageVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exascaleDBStorageVaultName); + ExascaleDBStorageVaultResource exascaleDBStorageVault = client.GetExascaleDBStorageVaultResource(exascaleDBStorageVaultResourceId); + + // invoke the operation + ExascaleDBStorageVaultPatch patch = new ExascaleDBStorageVaultPatch + { + Tags = +{ +["key6179"] = "ouj" +}, + }; + ArmOperation lro = await exascaleDBStorageVault.UpdateAsync(WaitUntil.Completed, patch); + ExascaleDBStorageVaultResource 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 + ExascaleDBStorageVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentCollection.cs new file mode 100644 index 000000000000..a7f9b03c6785 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentCollection.cs @@ -0,0 +1,159 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_FlexComponentCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FlexComponentsGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/FlexComponents_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FlexComponents_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this FlexComponentResource + AzureLocation location = new AzureLocation("eastus"); + FlexComponentCollection collection = subscriptionResource.GetFlexComponents(location); + + // invoke the operation + string flexComponentName = "flexComponent"; + FlexComponentResource result = await collection.GetAsync(flexComponentName); + + // 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 + FlexComponentData 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_FlexComponentsListByParentMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/FlexComponents_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "FlexComponents_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this FlexComponentResource + AzureLocation location = new AzureLocation("eastus"); + FlexComponentCollection collection = subscriptionResource.GetFlexComponents(location); + + // invoke the operation and iterate over the result + SystemShape? shape = SystemShape.ExadataX11M; + await foreach (FlexComponentResource item in collection.GetAllAsync(shape: shape)) + { + // 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 + FlexComponentData 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_FlexComponentsGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/FlexComponents_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FlexComponents_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this FlexComponentResource + AzureLocation location = new AzureLocation("eastus"); + FlexComponentCollection collection = subscriptionResource.GetFlexComponents(location); + + // invoke the operation + string flexComponentName = "flexComponent"; + bool result = await collection.ExistsAsync(flexComponentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_FlexComponentsGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/FlexComponents_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FlexComponents_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this FlexComponentResource + AzureLocation location = new AzureLocation("eastus"); + FlexComponentCollection collection = subscriptionResource.GetFlexComponents(location); + + // invoke the operation + string flexComponentName = "flexComponent"; + NullableResponse response = await collection.GetIfExistsAsync(flexComponentName); + FlexComponentResource 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 + FlexComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentResource.cs new file mode 100644 index 000000000000..b28f0f616471 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentResource.cs @@ -0,0 +1,48 @@ +// 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.OracleDatabase.Samples +{ + public partial class Sample_FlexComponentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FlexComponentsGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/FlexComponents_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FlexComponents_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 FlexComponentResource created on azure + // for more information of creating FlexComponentResource, please refer to the document of FlexComponentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + AzureLocation location = new AzureLocation("eastus"); + string flexComponentName = "flexComponent"; + ResourceIdentifier flexComponentResourceId = FlexComponentResource.CreateResourceIdentifier(subscriptionId, location, flexComponentName); + FlexComponentResource flexComponent = client.GetFlexComponentResource(flexComponentResourceId); + + // invoke the operation + FlexComponentResource result = await flexComponent.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 + FlexComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionCollection.cs new file mode 100644 index 000000000000..c225342ccdc7 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionCollection.cs @@ -0,0 +1,162 @@ +// 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.OracleDatabase.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_GiMinorVersionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GiMinorVersionsGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiMinorVersions_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GiMinorVersions_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 OracleGIVersionResource created on azure + // for more information of creating OracleGIVersionResource, please refer to the document of OracleGIVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + AzureLocation location = new AzureLocation("eastus"); + string giversionname = "giVersionName"; + ResourceIdentifier oracleGIVersionResourceId = OracleGIVersionResource.CreateResourceIdentifier(subscriptionId, location, giversionname); + OracleGIVersionResource oracleGIVersion = client.GetOracleGIVersionResource(oracleGIVersionResourceId); + + // get the collection of this GiMinorVersionResource + GiMinorVersionCollection collection = oracleGIVersion.GetGiMinorVersions(); + + // invoke the operation + string giMinorVersionName = "giMinorVersionName"; + GiMinorVersionResource result = await collection.GetAsync(giMinorVersionName); + + // 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 + GiMinorVersionData 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_GiMinorVersionsListByParentMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiMinorVersions_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "GiMinorVersions_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 OracleGIVersionResource created on azure + // for more information of creating OracleGIVersionResource, please refer to the document of OracleGIVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + AzureLocation location = new AzureLocation("eastus"); + string giversionname = "giVersionName"; + ResourceIdentifier oracleGIVersionResourceId = OracleGIVersionResource.CreateResourceIdentifier(subscriptionId, location, giversionname); + OracleGIVersionResource oracleGIVersion = client.GetOracleGIVersionResource(oracleGIVersionResourceId); + + // get the collection of this GiMinorVersionResource + GiMinorVersionCollection collection = oracleGIVersion.GetGiMinorVersions(); + + // invoke the operation and iterate over the result + ShapeFamily? shapeFamily = new ShapeFamily("rtfcosvtlpeeqoicsjqggtgc"); + await foreach (GiMinorVersionResource item in collection.GetAllAsync(shapeFamily: shapeFamily)) + { + // 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 + GiMinorVersionData 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_GiMinorVersionsGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiMinorVersions_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GiMinorVersions_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 OracleGIVersionResource created on azure + // for more information of creating OracleGIVersionResource, please refer to the document of OracleGIVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + AzureLocation location = new AzureLocation("eastus"); + string giversionname = "giVersionName"; + ResourceIdentifier oracleGIVersionResourceId = OracleGIVersionResource.CreateResourceIdentifier(subscriptionId, location, giversionname); + OracleGIVersionResource oracleGIVersion = client.GetOracleGIVersionResource(oracleGIVersionResourceId); + + // get the collection of this GiMinorVersionResource + GiMinorVersionCollection collection = oracleGIVersion.GetGiMinorVersions(); + + // invoke the operation + string giMinorVersionName = "giMinorVersionName"; + bool result = await collection.ExistsAsync(giMinorVersionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GiMinorVersionsGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiMinorVersions_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GiMinorVersions_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 OracleGIVersionResource created on azure + // for more information of creating OracleGIVersionResource, please refer to the document of OracleGIVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + AzureLocation location = new AzureLocation("eastus"); + string giversionname = "giVersionName"; + ResourceIdentifier oracleGIVersionResourceId = OracleGIVersionResource.CreateResourceIdentifier(subscriptionId, location, giversionname); + OracleGIVersionResource oracleGIVersion = client.GetOracleGIVersionResource(oracleGIVersionResourceId); + + // get the collection of this GiMinorVersionResource + GiMinorVersionCollection collection = oracleGIVersion.GetGiMinorVersions(); + + // invoke the operation + string giMinorVersionName = "giMinorVersionName"; + NullableResponse response = await collection.GetIfExistsAsync(giMinorVersionName); + GiMinorVersionResource 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 + GiMinorVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionResource.cs new file mode 100644 index 000000000000..890080f5fcbe --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionResource.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.OracleDatabase.Samples +{ + public partial class Sample_GiMinorVersionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GiMinorVersionsGetMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiMinorVersions_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GiMinorVersions_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 GiMinorVersionResource created on azure + // for more information of creating GiMinorVersionResource, please refer to the document of GiMinorVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + AzureLocation location = new AzureLocation("eastus"); + string giversionname = "giVersionName"; + string giMinorVersionName = "giMinorVersionName"; + ResourceIdentifier giMinorVersionResourceId = GiMinorVersionResource.CreateResourceIdentifier(subscriptionId, location, giversionname, giMinorVersionName); + GiMinorVersionResource giMinorVersion = client.GetGiMinorVersionResource(giMinorVersionResourceId); + + // invoke the operation + GiMinorVersionResource result = await giMinorVersion.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 + GiMinorVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBServerCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBServerCollection.cs index 9117d4574f23..24bfe3adfe17 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBServerCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBServerCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_OracleDBServerCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetDbServerByParent() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbServers_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbServers_get.json // this example is just showing the usage of "DbServers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,8 +53,8 @@ public async Task Get_GetDbServerByParent() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListDbServersByExadataInfrastructure() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbServers_listByParent.json - // this example is just showing the usage of "DbServers_ListByCloudExadataInfrastructure" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbServers_listByParent.json + // this example is just showing the usage of "DbServers_ListByParent" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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(); @@ -89,7 +89,7 @@ public async Task GetAll_ListDbServersByExadataInfrastructure() [Ignore("Only validating compilation of examples")] public async Task Exists_GetDbServerByParent() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbServers_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbServers_get.json // this example is just showing the usage of "DbServers_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 @@ -119,7 +119,7 @@ public async Task Exists_GetDbServerByParent() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetDbServerByParent() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbServers_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbServers_get.json // this example is just showing the usage of "DbServers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBServerResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBServerResource.cs index f48d07468acf..89db6f82f8a0 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBServerResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBServerResource.cs @@ -19,7 +19,7 @@ public partial class Sample_OracleDBServerResource [Ignore("Only validating compilation of examples")] public async Task Get_GetDbServerByParent() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbServers_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbServers_get.json // this example is just showing the usage of "DbServers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBSystemShapeCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBSystemShapeCollection.cs index 877072caccda..f34b897851ff 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBSystemShapeCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBSystemShapeCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_OracleDBSystemShapeCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetADbSystemShapeByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbSystemShapes_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbSystemShapes_get.json // this example is just showing the usage of "DbSystemShapes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetADbSystemShapeByName() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListDbSystemShapesByLocation() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbSystemShapes_listByLocation.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbSystemShapes_listByLocation.json // this example is just showing the usage of "DbSystemShapes_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task GetAll_ListDbSystemShapesByLocation() [Ignore("Only validating compilation of examples")] public async Task Exists_GetADbSystemShapeByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbSystemShapes_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbSystemShapes_get.json // this example is just showing the usage of "DbSystemShapes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Exists_GetADbSystemShapeByName() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetADbSystemShapeByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbSystemShapes_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbSystemShapes_get.json // this example is just showing the usage of "DbSystemShapes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBSystemShapeResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBSystemShapeResource.cs index 36e5e73449f8..ffeaadde8479 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBSystemShapeResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDBSystemShapeResource.cs @@ -19,7 +19,7 @@ public partial class Sample_OracleDBSystemShapeResource [Ignore("Only validating compilation of examples")] public async Task Get_GetADbSystemShapeByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dbSystemShapes_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dbSystemShapes_get.json // this example is just showing the usage of "DbSystemShapes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateViewCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateViewCollection.cs index fa29a753d3f1..f977a91058bc 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateViewCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateViewCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_OracleDnsPrivateViewCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetADnsPrivateViewByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateViews_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dnsPrivateViews_get.json // this example is just showing the usage of "DnsPrivateViews_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetADnsPrivateViewByName() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListDnsPrivateViewsByLocation() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateViews_listByLocation.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dnsPrivateViews_listByLocation.json // this example is just showing the usage of "DnsPrivateViews_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task GetAll_ListDnsPrivateViewsByLocation() [Ignore("Only validating compilation of examples")] public async Task Exists_GetADnsPrivateViewByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateViews_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dnsPrivateViews_get.json // this example is just showing the usage of "DnsPrivateViews_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Exists_GetADnsPrivateViewByName() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetADnsPrivateViewByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateViews_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dnsPrivateViews_get.json // this example is just showing the usage of "DnsPrivateViews_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateViewResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateViewResource.cs index 126e764a58f3..e55298d3f17b 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateViewResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateViewResource.cs @@ -19,7 +19,7 @@ public partial class Sample_OracleDnsPrivateViewResource [Ignore("Only validating compilation of examples")] public async Task Get_GetADnsPrivateViewByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateViews_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dnsPrivateViews_get.json // this example is just showing the usage of "DnsPrivateViews_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateZoneCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateZoneCollection.cs index 930b452fb00a..57c678a5f44f 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateZoneCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateZoneCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_OracleDnsPrivateZoneCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetADnsPrivateZoneByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateZones_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dnsPrivateZones_get.json // this example is just showing the usage of "DnsPrivateZones_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetADnsPrivateZoneByName() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListDnsPrivateZonesByLocation() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateZones_listByLocation.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dnsPrivateZones_listByLocation.json // this example is just showing the usage of "DnsPrivateZones_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task GetAll_ListDnsPrivateZonesByLocation() [Ignore("Only validating compilation of examples")] public async Task Exists_GetADnsPrivateZoneByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateZones_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dnsPrivateZones_get.json // this example is just showing the usage of "DnsPrivateZones_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Exists_GetADnsPrivateZoneByName() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetADnsPrivateZoneByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateZones_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dnsPrivateZones_get.json // this example is just showing the usage of "DnsPrivateZones_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateZoneResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateZoneResource.cs index b3f7b790f24b..c222d07fffa7 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateZoneResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleDnsPrivateZoneResource.cs @@ -19,7 +19,7 @@ public partial class Sample_OracleDnsPrivateZoneResource [Ignore("Only validating compilation of examples")] public async Task Get_GetADnsPrivateZoneByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/dnsPrivateZones_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/dnsPrivateZones_get.json // this example is just showing the usage of "DnsPrivateZones_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleGIVersionCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleGIVersionCollection.cs index fd8eb969d731..96ac279a34a7 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleGIVersionCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleGIVersionCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.OracleDatabase.Models; using Azure.ResourceManager.Resources; using NUnit.Framework; @@ -20,7 +21,7 @@ public partial class Sample_OracleGIVersionCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetAGiVersionByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/giVersions_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/giVersions_get.json // this example is just showing the usage of "GiVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,9 +52,111 @@ public async Task Get_GetAGiVersionByName() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetAll_ListGiVersionsByLocation() + public async Task Get_GetAGiVersionByNameGeneratedByMaximumSetRule() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/giVersions_listByLocation.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiVersions_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GiVersions_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this OracleGIVersionResource + AzureLocation location = new AzureLocation("eastus"); + OracleGIVersionCollection collection = subscriptionResource.GetOracleGIVersions(location); + + // invoke the operation + string giversionname = "giVersionName"; + OracleGIVersionResource result = await collection.GetAsync(giversionname); + + // 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 + OracleGIVersionData 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_GetAGiVersionByNameGeneratedByMinimumSetRule() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiVersions_Get_MinimumSet_Gen.json + // this example is just showing the usage of "GiVersions_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this OracleGIVersionResource + AzureLocation location = new AzureLocation("eastus"); + OracleGIVersionCollection collection = subscriptionResource.GetOracleGIVersions(location); + + // invoke the operation + string giversionname = "giVersionName"; + OracleGIVersionResource result = await collection.GetAsync(giversionname); + + // 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 + OracleGIVersionData 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_ListGiVersionsByLocationGeneratedByMaximumSetRule() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiVersions_ListByLocation_MaximumSet_Gen.json + // this example is just showing the usage of "GiVersions_ListByLocation" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + 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 = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this OracleGIVersionResource + AzureLocation location = new AzureLocation("eastus"); + OracleGIVersionCollection collection = subscriptionResource.GetOracleGIVersions(location); + + // invoke the operation and iterate over the result + SystemShape? shape = new SystemShape("osixsklyaauhoqnkxvnvsqeqenhzogntqnpubldrrfvqncwetdtwqwjjcvspwhgecbimdlulwcubikebrdzmidrucgtsuqvytkqutmbyrvvyioxpocpmuwiivyanjzucaegihztluuvpznzaoakfsselumhhsvrtrbzwpjhcihsvyouonlxdluwhqfxoqvgthkaxppbydtqjntscgzbivfdcaobbkthrbdjwpejirqmbly"); + await foreach (OracleGIVersionResource item in collection.GetAllAsync(shape: shape)) + { + // 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 + OracleGIVersionData 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 GetAll_ListGiVersionsByLocationGeneratedByMinimumSetRule() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiVersions_ListByLocation_MinimumSet_Gen.json // this example is just showing the usage of "GiVersions_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +191,7 @@ public async Task GetAll_ListGiVersionsByLocation() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAGiVersionByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/giVersions_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/giVersions_get.json // this example is just showing the usage of "GiVersions_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 @@ -113,11 +216,69 @@ public async Task Exists_GetAGiVersionByName() Console.WriteLine($"Succeeded: {result}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetAGiVersionByNameGeneratedByMaximumSetRule() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiVersions_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GiVersions_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this OracleGIVersionResource + AzureLocation location = new AzureLocation("eastus"); + OracleGIVersionCollection collection = subscriptionResource.GetOracleGIVersions(location); + + // invoke the operation + string giversionname = "giVersionName"; + bool result = await collection.ExistsAsync(giversionname); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetAGiVersionByNameGeneratedByMinimumSetRule() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiVersions_Get_MinimumSet_Gen.json + // this example is just showing the usage of "GiVersions_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this OracleGIVersionResource + AzureLocation location = new AzureLocation("eastus"); + OracleGIVersionCollection collection = subscriptionResource.GetOracleGIVersions(location); + + // invoke the operation + string giversionname = "giVersionName"; + bool result = await collection.ExistsAsync(giversionname); + + Console.WriteLine($"Succeeded: {result}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAGiVersionByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/giVersions_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/giVersions_get.json // this example is just showing the usage of "GiVersions_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 @@ -153,5 +314,87 @@ public async Task GetIfExists_GetAGiVersionByName() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetAGiVersionByNameGeneratedByMaximumSetRule() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiVersions_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GiVersions_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this OracleGIVersionResource + AzureLocation location = new AzureLocation("eastus"); + OracleGIVersionCollection collection = subscriptionResource.GetOracleGIVersions(location); + + // invoke the operation + string giversionname = "giVersionName"; + NullableResponse response = await collection.GetIfExistsAsync(giversionname); + OracleGIVersionResource 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 + OracleGIVersionData 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 GetIfExists_GetAGiVersionByNameGeneratedByMinimumSetRule() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiVersions_Get_MinimumSet_Gen.json + // this example is just showing the usage of "GiVersions_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this OracleGIVersionResource + AzureLocation location = new AzureLocation("eastus"); + OracleGIVersionCollection collection = subscriptionResource.GetOracleGIVersions(location); + + // invoke the operation + string giversionname = "giVersionName"; + NullableResponse response = await collection.GetIfExistsAsync(giversionname); + OracleGIVersionResource 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 + OracleGIVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleGIVersionResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleGIVersionResource.cs index 94f2c9198e3b..bbddda10483f 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleGIVersionResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleGIVersionResource.cs @@ -19,7 +19,7 @@ public partial class Sample_OracleGIVersionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAGiVersionByName() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/giVersions_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/giVersions_get.json // this example is just showing the usage of "GiVersions_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 @@ -44,5 +44,65 @@ public async Task Get_GetAGiVersionByName() // 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_GetAGiVersionByNameGeneratedByMaximumSetRule() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiVersions_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GiVersions_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 OracleGIVersionResource created on azure + // for more information of creating OracleGIVersionResource, please refer to the document of OracleGIVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + AzureLocation location = new AzureLocation("eastus"); + string giversionname = "giVersionName"; + ResourceIdentifier oracleGIVersionResourceId = OracleGIVersionResource.CreateResourceIdentifier(subscriptionId, location, giversionname); + OracleGIVersionResource oracleGIVersion = client.GetOracleGIVersionResource(oracleGIVersionResourceId); + + // invoke the operation + OracleGIVersionResource result = await oracleGIVersion.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 + OracleGIVersionData 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_GetAGiVersionByNameGeneratedByMinimumSetRule() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/GiVersions_Get_MinimumSet_Gen.json + // this example is just showing the usage of "GiVersions_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 OracleGIVersionResource created on azure + // for more information of creating OracleGIVersionResource, please refer to the document of OracleGIVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + AzureLocation location = new AzureLocation("eastus"); + string giversionname = "giVersionName"; + ResourceIdentifier oracleGIVersionResourceId = OracleGIVersionResource.CreateResourceIdentifier(subscriptionId, location, giversionname); + OracleGIVersionResource oracleGIVersion = client.GetOracleGIVersionResource(oracleGIVersionResourceId); + + // invoke the operation + OracleGIVersionResource result = await oracleGIVersion.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 + OracleGIVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSubscriptionResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSubscriptionResource.cs index 60bc41c70b99..50dd5b7e2fbe 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSubscriptionResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSubscriptionResource.cs @@ -21,7 +21,7 @@ public partial class Sample_OracleSubscriptionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetOracleSubscription() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_get.json // this example is just showing the usage of "OracleSubscriptions_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 @@ -49,7 +49,7 @@ public async Task Get_GetOracleSubscription() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteOracleSubscription() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_delete.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_delete.json // this example is just showing the usage of "OracleSubscriptions_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 @@ -73,7 +73,7 @@ public async Task Delete_DeleteOracleSubscription() [Ignore("Only validating compilation of examples")] public async Task Update_PatchOracleSubscription() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_patch.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_patch.json // this example is just showing the usage of "OracleSubscriptions_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 @@ -103,7 +103,7 @@ public async Task Update_PatchOracleSubscription() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateOracleSubscription() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_create.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_create.json // this example is just showing the usage of "OracleSubscriptions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -137,11 +137,36 @@ public async Task CreateOrUpdate_CreateOrUpdateOracleSubscription() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task AddAzureSubscriptions_AddAzureSubscriptionsToTheOracleSubscription() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_addAzureSubscriptions.json + // this example is just showing the usage of "OracleSubscriptions_AddAzureSubscriptions" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 OracleSubscriptionResource created on azure + // for more information of creating OracleSubscriptionResource, please refer to the document of OracleSubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier oracleSubscriptionResourceId = OracleSubscriptionResource.CreateResourceIdentifier(subscriptionId); + OracleSubscriptionResource oracleSubscription = client.GetOracleSubscriptionResource(oracleSubscriptionResourceId); + + // invoke the operation + AzureSubscriptions body = new AzureSubscriptions(new string[] { "00000000-0000-0000-0000-000000000001" }); + await oracleSubscription.AddAzureSubscriptionsAsync(WaitUntil.Completed, body); + + Console.WriteLine("Succeeded"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task GetActivationLinks_ListActivationLinksForTheOracleSubscription() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listActivationLinks.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_listActivationLinks.json // this example is just showing the usage of "OracleSubscriptions_ListActivationLinks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +191,7 @@ public async Task GetActivationLinks_ListActivationLinksForTheOracleSubscription [Ignore("Only validating compilation of examples")] public async Task GetCloudAccountDetails_ListCloudAccountDetailsForTheOracleSubscription() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listCloudAccountDetails.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_listCloudAccountDetails.json // this example is just showing the usage of "OracleSubscriptions_ListCloudAccountDetails" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -191,7 +216,7 @@ public async Task GetCloudAccountDetails_ListCloudAccountDetailsForTheOracleSubs [Ignore("Only validating compilation of examples")] public async Task GetSaasSubscriptionDetails_ListSaasSubscriptionDetailsForTheOracleSubscription() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/oracleSubscriptions_listSaasSubscriptionDetails.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/oracleSubscriptions_listSaasSubscriptionDetails.json // this example is just showing the usage of "OracleSubscriptions_ListSaasSubscriptionDetails" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSystemVersionCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSystemVersionCollection.cs index 60f08ead9fd3..bafddc62b079 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSystemVersionCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSystemVersionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_OracleSystemVersionCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetExadataSystemVersion() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/systemVersions_get.json // this example is just showing the usage of "SystemVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetExadataSystemVersion() [Ignore("Only validating compilation of examples")] public async Task Get_SystemVersionsListSystemVersions() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/systemVersions_get.json // this example is just showing the usage of "SystemVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Get_SystemVersionsListSystemVersions() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListExadataSystemVersionsByTheProvidedFilter() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_listByLocation.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/systemVersions_listByLocation.json // this example is just showing the usage of "SystemVersions_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -121,7 +121,7 @@ public async Task GetAll_ListExadataSystemVersionsByTheProvidedFilter() [Ignore("Only validating compilation of examples")] public async Task GetAll_SystemVersionsListByLocation() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_listByLocation.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/systemVersions_listByLocation.json // this example is just showing the usage of "SystemVersions_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +156,7 @@ public async Task GetAll_SystemVersionsListByLocation() [Ignore("Only validating compilation of examples")] public async Task Exists_GetExadataSystemVersion() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/systemVersions_get.json // this example is just showing the usage of "SystemVersions_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 @@ -185,7 +185,7 @@ public async Task Exists_GetExadataSystemVersion() [Ignore("Only validating compilation of examples")] public async Task Exists_SystemVersionsListSystemVersions() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/systemVersions_get.json // this example is just showing the usage of "SystemVersions_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 @@ -214,7 +214,7 @@ public async Task Exists_SystemVersionsListSystemVersions() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetExadataSystemVersion() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/systemVersions_get.json // this example is just showing the usage of "SystemVersions_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 @@ -255,7 +255,7 @@ public async Task GetIfExists_GetExadataSystemVersion() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_SystemVersionsListSystemVersions() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/systemVersions_get.json // this example is just showing the usage of "SystemVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSystemVersionResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSystemVersionResource.cs index 7dd004f8ea51..b43f3c493809 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSystemVersionResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSystemVersionResource.cs @@ -19,7 +19,7 @@ public partial class Sample_OracleSystemVersionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetExadataSystemVersion() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/systemVersions_get.json // this example is just showing the usage of "SystemVersions_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 @@ -49,7 +49,7 @@ public async Task Get_GetExadataSystemVersion() [Ignore("Only validating compilation of examples")] public async Task Get_SystemVersionsListSystemVersions() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/systemVersions_get.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/systemVersions_get.json // this example is just showing the usage of "SystemVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 1db88b434f91..83d19b3d99a9 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -20,7 +20,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetAutonomousDatabases_ListAutonomousDatabaseBySubscription() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/autonomousDatabase_listBySubscription.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/autonomousDatabase_listBySubscription.json // this example is just showing the usage of "AutonomousDatabases_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 @@ -51,7 +51,7 @@ public async Task GetAutonomousDatabases_ListAutonomousDatabaseBySubscription() [Ignore("Only validating compilation of examples")] public async Task GetCloudExadataInfrastructures_ListExadataInfrastructureBySubscription() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/exaInfra_listBySubscription.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/exaInfra_listBySubscription.json // this example is just showing the usage of "CloudExadataInfrastructures_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 @@ -82,7 +82,7 @@ public async Task GetCloudExadataInfrastructures_ListExadataInfrastructureBySubs [Ignore("Only validating compilation of examples")] public async Task GetCloudVmClusters_ListVMClustersBySubscription() { - // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2023-09-01/examples/vmClusters_listBySubscription.json + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/vmClusters_listBySubscription.json // this example is just showing the usage of "CloudVmClusters_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 @@ -108,5 +108,67 @@ public async Task GetCloudVmClusters_ListVMClustersBySubscription() Console.WriteLine("Succeeded"); } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetExadbVmClusters_ExadbVmClustersListBySubscriptionMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExadbVmClusters_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "ExadbVmClusters_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 = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (ExadbVmClusterResource item in subscriptionResource.GetExadbVmClustersAsync()) + { + // 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 + ExadbVmClusterData 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 GetExascaleDBStorageVaults_ExascaleDbStorageVaultsListBySubscriptionMaximumSet() + { + // Generated from example definition: specification/oracle/resource-manager/Oracle.Database/stable/2025-03-01/examples/ExascaleDbStorageVaults_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVaults_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 = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (ExascaleDBStorageVaultResource item in subscriptionResource.GetExascaleDBStorageVaultsAsync()) + { + // 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 + ExascaleDBStorageVaultData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ArmOracleDatabaseModelFactory.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ArmOracleDatabaseModelFactory.cs index bfd7327b51ae..aa05b0ebf762 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ArmOracleDatabaseModelFactory.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ArmOracleDatabaseModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -26,7 +27,7 @@ public static partial class ArmOracleDatabaseModelFactory /// /// The resource-specific properties for this resource. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , , and . /// /// A new instance for mocking. public static AutonomousDatabaseData AutonomousDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, AutonomousDatabaseBaseProperties properties = null) @@ -60,11 +61,13 @@ public static AutonomousDatabaseData AutonomousDatabaseData(ResourceIdentifier i /// The user-friendly name for the Autonomous Database. /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. /// Indicates if auto scaling is enabled for the Autonomous Database storage. - /// The list of [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs. - /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. /// Local Autonomous Disaster Recovery standby database details. /// Indicates the number of seconds of data loss for a Data Guard failover. /// Specifies if the Autonomous Database requires mTLS connections. @@ -121,7 +124,7 @@ public static AutonomousDatabaseData AutonomousDatabaseData(ResourceIdentifier i /// Retention period, in days, for long-term backups. /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. /// A new instance for mocking. - public static AutonomousDatabaseBaseProperties AutonomousDatabaseBaseProperties(string adminPassword = null, string dataBaseType = null, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = null, string characterSet = null, float? computeCount = null, AutonomousDatabaseComputeModel? computeModel = null, int? cpuCoreCount = null, IEnumerable customerContacts = null, int? dataStorageSizeInTbs = null, int? dataStorageSizeInGbs = null, string dbVersion = null, AutonomousDatabaseWorkloadType? dbWorkload = null, string displayName = null, bool? isAutoScalingEnabled = null, bool? isAutoScalingForStorageEnabled = null, IEnumerable peerDBIds = null, string peerDBId = null, bool? isLocalDataGuardEnabled = null, bool? isRemoteDataGuardEnabled = null, DisasterRecoveryType? localDisasterRecoveryType = null, AutonomousDatabaseStandbySummary localStandbyDB = null, int? failedDataRecoveryInSeconds = null, bool? isMtlsConnectionRequired = null, bool? isPreviewVersionWithServiceTermsAccepted = null, OracleLicenseModel? licenseModel = null, string ncharacterSet = null, string lifecycleDetails = null, OracleDatabaseProvisioningState? provisioningState = null, AutonomousDatabaseLifecycleState? lifecycleState = null, ScheduledOperationsType scheduledOperations = null, string privateEndpointIP = null, string privateEndpointLabel = null, Uri ociUri = null, ResourceIdentifier subnetId = null, ResourceIdentifier vnetId = null, DateTimeOffset? createdOn = null, DateTimeOffset? maintenanceBeginOn = null, DateTimeOffset? maintenanceEndOn = null, double? actualUsedDataStorageSizeInTbs = null, double? allocatedStorageSizeInTbs = null, OracleApexDetailsType apexDetails = null, IEnumerable availableUpgradeVersions = null, AutonomousDatabaseConnectionStrings connectionStrings = null, AutonomousDatabaseConnectionUrls connectionUrls = null, DataSafeStatusType? dataSafeStatus = null, OracleDatabaseEditionType? databaseEdition = null, ResourceIdentifier autonomousDatabaseId = null, int? inMemoryAreaInGbs = null, DateTimeOffset? nextLongTermBackupCreatedOn = null, LongTermBackUpScheduleDetails longTermBackupSchedule = null, bool? isPreview = null, int? localAdgAutoFailoverMaxDataLossLimit = null, int? memoryPerOracleComputeUnitInGbs = null, AutonomousDatabaseModeType? openMode = null, OperationsInsightsStatusType? operationsInsightsStatus = null, AutonomousDatabasePermissionLevelType? permissionLevel = null, string privateEndpoint = null, IEnumerable provisionableCpus = null, DataGuardRoleType? role = null, Uri serviceConsoleUri = null, Uri sqlWebDeveloperUri = null, IEnumerable supportedRegionsToCloneTo = null, DateTimeOffset? dataGuardRoleChangedOn = null, DateTimeOffset? freeAutonomousDatabaseDeletedOn = null, string timeLocalDataGuardEnabled = null, DateTimeOffset? lastFailoverHappenedOn = null, DateTimeOffset? lastRefreshHappenedOn = null, DateTimeOffset? lastRefreshPointTimestamp = null, DateTimeOffset? lastSwitchoverHappenedOn = null, DateTimeOffset? freeAutonomousDatabaseStoppedOn = null, int? usedDataStorageSizeInGbs = null, int? usedDataStorageSizeInTbs = null, ResourceIdentifier ocid = null, int? backupRetentionPeriodInDays = null, IEnumerable whitelistedIPs = null) + public static AutonomousDatabaseBaseProperties AutonomousDatabaseBaseProperties(string adminPassword = null, string dataBaseType = null, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = null, string characterSet = null, float? computeCount = null, AutonomousDatabaseComputeModel? computeModel = null, int? cpuCoreCount = null, IEnumerable customerContacts = null, int? dataStorageSizeInTbs = null, int? dataStorageSizeInGbs = null, string dbVersion = null, AutonomousDatabaseWorkloadType? dbWorkload = null, string displayName = null, bool? isAutoScalingEnabled = null, bool? isAutoScalingForStorageEnabled = null, IEnumerable peerDBIds = null, string peerDBId = null, bool? isLocalDataGuardEnabled = null, bool? isRemoteDataGuardEnabled = null, DisasterRecoveryType? localDisasterRecoveryType = null, DateTimeOffset? timeDisasterRecoveryRoleChanged = null, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = null, AutonomousDatabaseStandbySummary localStandbyDB = null, int? failedDataRecoveryInSeconds = null, bool? isMtlsConnectionRequired = null, bool? isPreviewVersionWithServiceTermsAccepted = null, OracleLicenseModel? licenseModel = null, string ncharacterSet = null, string lifecycleDetails = null, OracleDatabaseProvisioningState? provisioningState = null, AutonomousDatabaseLifecycleState? lifecycleState = null, ScheduledOperationsType scheduledOperations = null, string privateEndpointIP = null, string privateEndpointLabel = null, Uri ociUri = null, ResourceIdentifier subnetId = null, ResourceIdentifier vnetId = null, DateTimeOffset? createdOn = null, DateTimeOffset? maintenanceBeginOn = null, DateTimeOffset? maintenanceEndOn = null, double? actualUsedDataStorageSizeInTbs = null, double? allocatedStorageSizeInTbs = null, OracleApexDetailsType apexDetails = null, IEnumerable availableUpgradeVersions = null, AutonomousDatabaseConnectionStrings connectionStrings = null, AutonomousDatabaseConnectionUrls connectionUrls = null, DataSafeStatusType? dataSafeStatus = null, OracleDatabaseEditionType? databaseEdition = null, ResourceIdentifier autonomousDatabaseId = null, int? inMemoryAreaInGbs = null, DateTimeOffset? nextLongTermBackupCreatedOn = null, LongTermBackUpScheduleDetails longTermBackupSchedule = null, bool? isPreview = null, int? localAdgAutoFailoverMaxDataLossLimit = null, int? memoryPerOracleComputeUnitInGbs = null, AutonomousDatabaseModeType? openMode = null, OperationsInsightsStatusType? operationsInsightsStatus = null, AutonomousDatabasePermissionLevelType? permissionLevel = null, string privateEndpoint = null, IEnumerable provisionableCpus = null, DataGuardRoleType? role = null, Uri serviceConsoleUri = null, Uri sqlWebDeveloperUri = null, IEnumerable supportedRegionsToCloneTo = null, DateTimeOffset? dataGuardRoleChangedOn = null, DateTimeOffset? freeAutonomousDatabaseDeletedOn = null, string timeLocalDataGuardEnabled = null, DateTimeOffset? lastFailoverHappenedOn = null, DateTimeOffset? lastRefreshHappenedOn = null, DateTimeOffset? lastRefreshPointTimestamp = null, DateTimeOffset? lastSwitchoverHappenedOn = null, DateTimeOffset? freeAutonomousDatabaseStoppedOn = null, int? usedDataStorageSizeInGbs = null, int? usedDataStorageSizeInTbs = null, ResourceIdentifier ocid = null, int? backupRetentionPeriodInDays = null, IEnumerable whitelistedIPs = null) { customerContacts ??= new List(); peerDBIds ??= new List(); @@ -151,6 +154,8 @@ public static AutonomousDatabaseBaseProperties AutonomousDatabaseBaseProperties( isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, localStandbyDB, failedDataRecoveryInSeconds, isMtlsConnectionRequired, @@ -344,6 +349,7 @@ public static CloudExadataInfrastructureData CloudExadataInfrastructureData(Reso } /// Initializes a new instance of . + /// Defined file system configurations. /// Exadata infra ocid. /// The number of compute servers for the cloud Exadata infrastructure. /// The number of storage servers for the cloud Exadata infrastructure. @@ -375,12 +381,17 @@ public static CloudExadataInfrastructureData CloudExadataInfrastructureData(Reso /// The OCID of the next maintenance run. /// Monthly Db Server version. /// Monthly Storage Server version. + /// The database server model type of the cloud Exadata infrastructure resource. + /// The storage server model type of the cloud Exadata infrastructure resource. + /// The compute model of the Exadata Infrastructure. /// A new instance for mocking. - public static CloudExadataInfrastructureProperties CloudExadataInfrastructureProperties(ResourceIdentifier ocid = null, int? computeCount = null, int? storageCount = null, int? totalStorageSizeInGbs = null, int? availableStorageSizeInGbs = null, DateTimeOffset? createdOn = null, string lifecycleDetails = null, OracleDatabaseMaintenanceWindow maintenanceWindow = null, EstimatedPatchingTime estimatedPatchingTime = null, IEnumerable customerContacts = null, OracleDatabaseProvisioningState? provisioningState = null, CloudExadataInfrastructureLifecycleState? lifecycleState = null, string shape = null, Uri ociUri = null, int? cpuCount = null, int? maxCpuCount = null, int? memorySizeInGbs = null, int? maxMemoryInGbs = null, int? dbNodeStorageSizeInGbs = null, int? maxDBNodeStorageSizeInGbs = null, double? dataStorageSizeInTbs = null, double? maxDataStorageInTbs = null, string dbServerVersion = null, string storageServerVersion = null, int? activatedStorageCount = null, int? additionalStorageCount = null, string displayName = null, ResourceIdentifier lastMaintenanceRunId = null, ResourceIdentifier nextMaintenanceRunId = null, string monthlyDBServerVersion = null, string monthlyStorageServerVersion = null) + public static CloudExadataInfrastructureProperties CloudExadataInfrastructureProperties(IEnumerable definedFileSystemConfiguration = null, ResourceIdentifier ocid = null, int? computeCount = null, int? storageCount = null, int? totalStorageSizeInGbs = null, int? availableStorageSizeInGbs = null, DateTimeOffset? createdOn = null, string lifecycleDetails = null, OracleDatabaseMaintenanceWindow maintenanceWindow = null, EstimatedPatchingTime estimatedPatchingTime = null, IEnumerable customerContacts = null, OracleDatabaseProvisioningState? provisioningState = null, CloudExadataInfrastructureLifecycleState? lifecycleState = null, string shape = null, Uri ociUri = null, int? cpuCount = null, int? maxCpuCount = null, int? memorySizeInGbs = null, int? maxMemoryInGbs = null, int? dbNodeStorageSizeInGbs = null, int? maxDBNodeStorageSizeInGbs = null, double? dataStorageSizeInTbs = null, double? maxDataStorageInTbs = null, string dbServerVersion = null, string storageServerVersion = null, int? activatedStorageCount = null, int? additionalStorageCount = null, string displayName = null, ResourceIdentifier lastMaintenanceRunId = null, ResourceIdentifier nextMaintenanceRunId = null, string monthlyDBServerVersion = null, string monthlyStorageServerVersion = null, string databaseServerType = null, string storageServerType = null, AutonomousDatabaseComputeModel? computeModel = null) { + definedFileSystemConfiguration ??= new List(); customerContacts ??= new List(); return new CloudExadataInfrastructureProperties( + definedFileSystemConfiguration?.ToList(), ocid, computeCount, storageCount, @@ -412,9 +423,23 @@ public static CloudExadataInfrastructureProperties CloudExadataInfrastructurePro nextMaintenanceRunId, monthlyDBServerVersion, monthlyStorageServerVersion, + databaseServerType, + storageServerType, + computeModel, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Checks if the data can be backed up. + /// Checks if the mount path is resizable. + /// Minimum size of mount path in Gb. + /// Mount path for the file system. + /// A new instance for mocking. + public static DefinedFileSystemConfiguration DefinedFileSystemConfiguration(bool? isBackupPartition = null, bool? isResizable = null, int? minSizeGb = null, string mountPoint = null) + { + return new DefinedFileSystemConfiguration(isBackupPartition, isResizable, minSizeGb, mountPoint, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The estimated time required in minutes for database server patching. /// The estimated time required in minutes for network switch patching. @@ -455,6 +480,7 @@ public static CloudVmClusterData CloudVmClusterData(ResourceIdentifier id = null /// The port number configured for the listener on the cloud VM cluster. /// The number of nodes in the cloud VM cluster. /// The data disk group size to be allocated in GBs per VM. + /// Array of mount path and size. /// The data disk group size to be allocated in TBs. /// The local node storage to be allocated in GBs. /// The memory to be allocated in GBs. @@ -499,9 +525,11 @@ public static CloudVmClusterData CloudVmClusterData(ResourceIdentifier id = null /// The list of DB servers. /// Cluster compartmentId. /// Cluster subnet ocid. + /// The compute model of the VM Cluster. /// A new instance for mocking. - public static CloudVmClusterProperties CloudVmClusterProperties(ResourceIdentifier ocid = null, long? listenerPort = null, int? nodeCount = null, int? storageSizeInGbs = null, double? dataStorageSizeInTbs = null, int? dbNodeStorageSizeInGbs = null, int? memorySizeInGbs = null, DateTimeOffset? createdOn = null, string lifecycleDetails = null, string timeZone = null, ResourceIdentifier zoneId = null, string hostname = null, string domain = null, int cpuCoreCount = default, float? ocpuCount = null, string clusterName = null, int? dataStoragePercentage = null, bool? isLocalBackupEnabled = null, ResourceIdentifier cloudExadataInfrastructureId = null, bool? isSparseDiskgroupEnabled = null, string systemVersion = null, IEnumerable sshPublicKeys = null, OracleLicenseModel? licenseModel = null, CloudVmClusterDiskRedundancy? diskRedundancy = null, IEnumerable scanIPIds = null, IEnumerable vipIds = null, string scanDnsName = null, int? scanListenerPortTcp = null, int? scanListenerPortTcpSsl = null, ResourceIdentifier scanDnsRecordId = null, string shape = null, OracleDatabaseProvisioningState? provisioningState = null, CloudVmClusterLifecycleState? lifecycleState = null, ResourceIdentifier vnetId = null, string giVersion = null, Uri ociUri = null, Uri nsgUri = null, ResourceIdentifier subnetId = null, string backupSubnetCidr = null, IEnumerable nsgCidrs = null, DiagnosticCollectionConfig dataCollectionOptions = null, string displayName = null, IEnumerable computeNodes = null, ExadataIormConfig iormConfigCache = null, ResourceIdentifier lastUpdateHistoryEntryId = null, IEnumerable dbServers = null, ResourceIdentifier compartmentId = null, ResourceIdentifier subnetOcid = null) + public static CloudVmClusterProperties CloudVmClusterProperties(ResourceIdentifier ocid = null, long? listenerPort = null, int? nodeCount = null, int? storageSizeInGbs = null, IEnumerable fileSystemConfigurationDetails = null, double? dataStorageSizeInTbs = null, int? dbNodeStorageSizeInGbs = null, int? memorySizeInGbs = null, DateTimeOffset? createdOn = null, string lifecycleDetails = null, string timeZone = null, ResourceIdentifier zoneId = null, string hostname = null, string domain = null, int cpuCoreCount = default, float? ocpuCount = null, string clusterName = null, int? dataStoragePercentage = null, bool? isLocalBackupEnabled = null, ResourceIdentifier cloudExadataInfrastructureId = null, bool? isSparseDiskgroupEnabled = null, string systemVersion = null, IEnumerable sshPublicKeys = null, OracleLicenseModel? licenseModel = null, CloudVmClusterDiskRedundancy? diskRedundancy = null, IEnumerable scanIPIds = null, IEnumerable vipIds = null, string scanDnsName = null, int? scanListenerPortTcp = null, int? scanListenerPortTcpSsl = null, ResourceIdentifier scanDnsRecordId = null, string shape = null, OracleDatabaseProvisioningState? provisioningState = null, CloudVmClusterLifecycleState? lifecycleState = null, ResourceIdentifier vnetId = null, string giVersion = null, Uri ociUri = null, Uri nsgUri = null, ResourceIdentifier subnetId = null, string backupSubnetCidr = null, IEnumerable nsgCidrs = null, DiagnosticCollectionConfig dataCollectionOptions = null, string displayName = null, IEnumerable computeNodes = null, ExadataIormConfig iormConfigCache = null, ResourceIdentifier lastUpdateHistoryEntryId = null, IEnumerable dbServers = null, ResourceIdentifier compartmentId = null, ResourceIdentifier subnetOcid = null, AutonomousDatabaseComputeModel? computeModel = null) { + fileSystemConfigurationDetails ??= new List(); sshPublicKeys ??= new List(); scanIPIds ??= new List(); vipIds ??= new List(); @@ -514,6 +542,7 @@ public static CloudVmClusterProperties CloudVmClusterProperties(ResourceIdentifi listenerPort, nodeCount, storageSizeInGbs, + fileSystemConfigurationDetails?.ToList(), dataStorageSizeInTbs, dbNodeStorageSizeInGbs, memorySizeInGbs, @@ -558,6 +587,7 @@ public static CloudVmClusterProperties CloudVmClusterProperties(ResourceIdentifi dbServers?.ToList(), compartmentId, subnetOcid, + computeModel, serializedAdditionalRawData: null); } @@ -584,6 +614,200 @@ public static DBIormConfig DBIormConfig(string dbName = null, string flashCacheL return new DBIormConfig(dbName, flashCacheLimit, share, 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 availability zones. + /// A new instance for mocking. + public static ExadbVmClusterData ExadbVmClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExadbVmClusterProperties properties = null, IEnumerable zones = null) + { + tags ??= new Dictionary(); + zones ??= new List(); + + return new ExadbVmClusterData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + zones?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// ExadbVmCluster ocid. + /// The cluster name for Exadata VM cluster on Exascale Infrastructure. The cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + /// Client OCI backup subnet CIDR, default is 192.168.252.0/22. + /// HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface. + /// Exadata VM cluster on Exascale Infrastructure provisioning state. + /// CloudVmCluster lifecycle state. + /// VNET for network connectivity. + /// Client subnet. + /// Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + /// Display Name. + /// A domain name used for the Exadata VM cluster on Exascale Infrastructure. + /// The number of ECPUs to enable for an Exadata VM cluster on Exascale Infrastructure. + /// The Azure Resource ID of the Exadata Database Storage Vault. + /// Grid Setup will be done using this Grid Image OCID. Can be obtained using giMinorVersions API. + /// The type of Grid Image. + /// Oracle Grid Infrastructure (GI) software version. + /// The hostname for the Exadata VM cluster on Exascale Infrastructure. + /// The Oracle license model that applies to the Exadata VM cluster on Exascale Infrastructure. The default is LICENSE_INCLUDED. + /// The memory that you want to be allocated in GBs. Memory is calculated based on 11 GB per VM core reserved. + /// The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + /// CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster will be added by default. + /// The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with. + /// The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with. + /// The TCP Single Client Access Name (SCAN) port. The default port is 1521. + /// The TCPS Single Client Access Name (SCAN) port. The default port is 2484. + /// The port number configured for the listener on the Exadata VM cluster on Exascale Infrastructure. + /// The shape of the Exadata VM cluster on Exascale Infrastructure resource. + /// The public key portion of one or more key pairs used for SSH access to the Exadata VM cluster on Exascale Infrastructure. + /// Operating system version of the image. + /// The time zone of the Exadata VM cluster on Exascale Infrastructure. For details, see [Exadata Infrastructure Time Zones](/Content/Database/References/timezones.htm). + /// The number of Total ECPUs for an Exadata VM cluster on Exascale Infrastructure. + /// Filesystem storage details. + /// Additional information about the current lifecycle state. + /// The FQDN of the DNS record for the SCAN IP addresses that are associated with the Exadata VM cluster on Exascale Infrastructure. + /// The Single Client Access Name (SCAN) IP addresses associated with the Exadata VM cluster on Exascale Infrastructure. SCAN IP addresses are typically used for load balancing and are not assigned to any interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. **Note:** For a single-node DB system, this list is empty. + /// The OCID of the DNS record for the SCAN IP addresses that are associated with the Exadata VM cluster on Exascale Infrastructure. + /// Snapshot filesystem storage details. + /// Total file system storage details. + /// The virtual IP (VIP) addresses associated with the Exadata VM cluster on Exascale Infrastructure. The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata Cloud Service instance to enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. **Note:** For a single-node DB system, this list is empty. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// iormConfigCache details for Exadata VM cluster on Exascale Infrastructure. + /// Cluster backup subnet ocid. + /// Cluster subnet ocid. + /// A new instance for mocking. + public static ExadbVmClusterProperties ExadbVmClusterProperties(ResourceIdentifier ocid = null, string clusterName = null, string backupSubnetCidr = null, Uri nsgUri = null, OracleDatabaseProvisioningState? provisioningState = null, ExadbVmClusterLifecycleState? lifecycleState = null, ResourceIdentifier vnetId = null, ResourceIdentifier subnetId = null, DiagnosticCollectionConfig dataCollectionOptions = null, string displayName = null, string domain = null, int enabledEcpuCount = default, ResourceIdentifier exascaleDBStorageVaultId = null, ResourceIdentifier gridImageOcid = null, GridImageType? gridImageType = null, string giVersion = null, string hostname = null, OracleLicenseModel? licenseModel = null, int? memorySizeInGbs = null, int nodeCount = default, IEnumerable nsgCidrs = null, ResourceIdentifier zoneOcid = null, ResourceIdentifier privateZoneOcid = null, int? scanListenerPortTcp = null, int? scanListenerPortTcpSsl = null, int? listenerPort = null, string shape = null, IEnumerable sshPublicKeys = null, string systemVersion = null, string timeZone = null, int totalEcpuCount = default, int? vmFileSystemStorageTotalSizeInGbs = null, string lifecycleDetails = null, string scanDnsName = null, IEnumerable scanIPIds = null, ResourceIdentifier scanDnsRecordId = null, int? snapshotFileSystemStorageTotalSizeInGbs = null, int? totalSizeInGbs = null, IEnumerable vipIds = null, Uri ociUri = null, ExadataIormConfig iormConfigCache = null, ResourceIdentifier backupSubnetOcid = null, ResourceIdentifier subnetOcid = null) + { + nsgCidrs ??= new List(); + sshPublicKeys ??= new List(); + scanIPIds ??= new List(); + vipIds ??= new List(); + + return new ExadbVmClusterProperties( + ocid, + clusterName, + backupSubnetCidr, + nsgUri, + provisioningState, + lifecycleState, + vnetId, + subnetId, + dataCollectionOptions, + displayName, + domain, + enabledEcpuCount, + exascaleDBStorageVaultId, + gridImageOcid, + gridImageType, + giVersion, + hostname, + licenseModel, + memorySizeInGbs, + nodeCount, + nsgCidrs?.ToList(), + zoneOcid, + privateZoneOcid, + scanListenerPortTcp, + scanListenerPortTcpSsl, + listenerPort, + shape, + sshPublicKeys?.ToList(), + systemVersion, + timeZone, + totalEcpuCount, + vmFileSystemStorageTotalSizeInGbs.HasValue ? new ExadbVmClusterStorageDetails(vmFileSystemStorageTotalSizeInGbs.Value, serializedAdditionalRawData: null) : null, + lifecycleDetails, + scanDnsName, + scanIPIds?.ToList(), + scanDnsRecordId, + snapshotFileSystemStorageTotalSizeInGbs.HasValue ? new ExadbVmClusterStorageDetails(snapshotFileSystemStorageTotalSizeInGbs.Value, serializedAdditionalRawData: null) : null, + totalSizeInGbs.HasValue ? new ExadbVmClusterStorageDetails(totalSizeInGbs.Value, serializedAdditionalRawData: null) : null, + vipIds?.ToList(), + ociUri, + iormConfigCache, + backupSubnetOcid, + subnetOcid, + 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 availability zones. + /// A new instance for mocking. + public static ExascaleDBStorageVaultData ExascaleDBStorageVaultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExascaleDBStorageVaultProperties properties = null, IEnumerable zones = null) + { + tags ??= new Dictionary(); + zones ??= new List(); + + return new ExascaleDBStorageVaultData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + zones?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The size of additional Flash Cache in percentage of High Capacity database storage. + /// Exadata Database Storage Vault description. + /// The user-friendly name for the Exadata Database Storage Vault. The name does not need to be unique. + /// Create exadata Database Storage Details. + /// Response exadata Database Storage Details. + /// The time zone that you want to use for the Exadata Database Storage Vault. + /// Exadata Database Storage Vault provisioning state. + /// Exadata Database Storage Vault lifecycle state. + /// Additional information about the current lifecycle state. + /// The number of Exadata VM clusters used the Exadata Database Storage Vault. + /// The OCID of the Exadata Database Storage Vault. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// A new instance for mocking. + public static ExascaleDBStorageVaultProperties ExascaleDBStorageVaultProperties(int? additionalFlashCacheInPercent = null, string description = null, string displayName = null, int? highCapacityDatabaseStorageInputTotalSizeInGbs = null, ExascaleDBStorageDetails highCapacityDatabaseStorage = null, string timeZone = null, OracleDatabaseProvisioningState? provisioningState = null, ExascaleDBStorageVaultLifecycleState? lifecycleState = null, string lifecycleDetails = null, int? vmClusterCount = null, ResourceIdentifier ocid = null, Uri ociUri = null) + { + return new ExascaleDBStorageVaultProperties( + additionalFlashCacheInPercent, + description, + displayName, + highCapacityDatabaseStorageInputTotalSizeInGbs.HasValue ? new ExascaleDBStorageInputDetails(highCapacityDatabaseStorageInputTotalSizeInGbs.Value, serializedAdditionalRawData: null) : null, + highCapacityDatabaseStorage, + timeZone, + provisioningState, + lifecycleState, + lifecycleDetails, + vmClusterCount, + ocid, + ociUri, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Available Capacity. + /// Total Capacity. + /// A new instance for mocking. + public static ExascaleDBStorageDetails ExascaleDBStorageDetails(int? availableSizeInGbs = null, int? totalSizeInGbs = null) + { + return new ExascaleDBStorageDetails(availableSizeInGbs, totalSizeInGbs, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -638,26 +862,6 @@ public static AutonomousDBVersionData AutonomousDBVersionData(ResourceIdentifier serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Supported Autonomous Db versions. - /// The Autonomous Database workload type. - /// True if this version of the Oracle Database software's default is free. - /// True if this version of the Oracle Database software's default is paid. - /// True if this version of the Oracle Database software can be used for Always-Free Autonomous Databases. - /// True if this version of the Oracle Database software has payments enabled. - /// A new instance for mocking. - public static AutonomousDBVersionProperties AutonomousDBVersionProperties(string version = null, AutonomousDatabaseWorkloadType? dbWorkload = null, bool? isDefaultForFree = null, bool? isDefaultForPaid = null, bool? isFreeTierEnabled = null, bool? isPaidEnabled = null) - { - return new AutonomousDBVersionProperties( - version, - dbWorkload, - isDefaultForFree, - isDefaultForPaid, - isFreeTierEnabled, - isPaidEnabled, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -676,54 +880,6 @@ public static OracleDBSystemShapeData OracleDBSystemShapeData(ResourceIdentifier serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The family of the shape used for the DB system. - /// The maximum number of CPU cores that can be enabled on the DB system for this shape. - /// The minimum number of CPU cores that can be enabled on the DB system for this shape. - /// The runtime minimum number of CPU cores that can be enabled on the DB system for this shape. - /// The discrete number by which the CPU core count for this shape can be increased or decreased. - /// The minimum number of Exadata storage servers available for the Exadata infrastructure. - /// The maximum number of Exadata storage servers available for the Exadata infrastructure. - /// The maximum data storage available per storage server for this shape. Only applicable to ExaCC Elastic shapes. - /// The maximum memory available per database node for this shape. Only applicable to ExaCC Elastic shapes. - /// The maximum Db Node storage available per database node for this shape. Only applicable to ExaCC Elastic shapes. - /// The minimum number of CPU cores that can be enabled per node for this shape. - /// The maximum memory that can be enabled for this shape. - /// The minimum memory that need be allocated per node for this shape. - /// The maximum Db Node storage that can be enabled for this shape. - /// The minimum Db Node storage that need be allocated per node for this shape. - /// The maximum DATA storage that can be enabled for this shape. - /// The minimum data storage that need be allocated for this shape. - /// The minimum number of database nodes available for this shape. - /// The maximum number of database nodes available for this shape. - /// The maximum number of CPU cores per database node that can be enabled for this shape. Only applicable to the flex Exadata shape and ExaCC Elastic shapes. - /// A new instance for mocking. - public static OracleDBSystemShapeProperties OracleDBSystemShapeProperties(string shapeFamily = null, int availableCoreCount = default, int? minimumCoreCount = null, int? runtimeMinimumCoreCount = null, int? coreCountIncrement = null, int? minStorageCount = null, int? maxStorageCount = null, double? availableDataStoragePerServerInTbs = null, int? availableMemoryPerNodeInGbs = null, int? availableDBNodePerNodeInGbs = null, int? minCoreCountPerNode = null, int? availableMemoryInGbs = null, int? minMemoryPerNodeInGbs = null, int? availableDBNodeStorageInGbs = null, int? minDBNodeStoragePerNodeInGbs = null, int? availableDataStorageInTbs = null, int? minDataStorageInTbs = null, int? minimumNodeCount = null, int? maximumNodeCount = null, int? availableCoreCountPerNode = null) - { - return new OracleDBSystemShapeProperties( - shapeFamily, - availableCoreCount, - minimumCoreCount, - runtimeMinimumCoreCount, - coreCountIncrement, - minStorageCount, - maxStorageCount, - availableDataStoragePerServerInTbs, - availableMemoryPerNodeInGbs, - availableDBNodePerNodeInGbs, - minCoreCountPerNode, - availableMemoryInGbs, - minMemoryPerNodeInGbs, - availableDBNodeStorageInGbs, - minDBNodeStoragePerNodeInGbs, - availableDataStorageInTbs, - minDataStorageInTbs, - minimumNodeCount, - maximumNodeCount, - availableCoreCountPerNode, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -752,7 +908,7 @@ public static OracleDnsPrivateViewData OracleDnsPrivateViewData(ResourceIdentifi /// views timeCreated. /// Azure resource provisioning state. /// A new instance for mocking. - public static OracleDnsPrivateViewProperties OracleDnsPrivateViewProperties(ResourceIdentifier ocid = null, string displayName = null, bool isProtected = default, DnsPrivateViewsLifecycleState? lifecycleState = null, string self = null, DateTimeOffset createdOn = default, DateTimeOffset updatedOn = default, OracleDatabaseResourceProvisioningState? provisioningState = null) + public static OracleDnsPrivateViewProperties OracleDnsPrivateViewProperties(ResourceIdentifier ocid = null, string displayName = null, bool isProtected = default, DnsPrivateViewsLifecycleState lifecycleState = default, string self = null, DateTimeOffset createdOn = default, DateTimeOffset updatedOn = default, OracleDatabaseResourceProvisioningState? provisioningState = null) { return new OracleDnsPrivateViewProperties( ocid, @@ -796,7 +952,7 @@ public static OracleDnsPrivateZoneData OracleDnsPrivateZoneData(ResourceIdentifi /// Zones timeCreated. /// Azure resource provisioning state. /// A new instance for mocking. - public static OracleDnsPrivateZoneProperties OracleDnsPrivateZoneProperties(ResourceIdentifier ocid = null, bool isProtected = default, DnsPrivateZonesLifecycleState? lifecycleState = null, string self = null, int serial = default, string version = null, ResourceIdentifier viewId = null, OracleDnsPrivateZoneType zoneType = default, DateTimeOffset createdOn = default, OracleDatabaseResourceProvisioningState? provisioningState = null) + public static OracleDnsPrivateZoneProperties OracleDnsPrivateZoneProperties(ResourceIdentifier ocid = null, bool isProtected = default, DnsPrivateZonesLifecycleState lifecycleState = default, string self = null, int serial = default, string version = null, ResourceIdentifier viewId = null, OracleDnsPrivateZoneType zoneType = default, DateTimeOffset createdOn = default, OracleDatabaseResourceProvisioningState? provisioningState = null) { return new OracleDnsPrivateZoneProperties( ocid, @@ -812,6 +968,52 @@ public static OracleDnsPrivateZoneProperties OracleDnsPrivateZoneProperties(Reso 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 FlexComponentData FlexComponentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, FlexComponentProperties properties = null) + { + return new FlexComponentData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The minimum number of CPU cores that can be enabled on the DB Server for this Flex Component. + /// The maximum number of CPU cores that can be enabled on the DB Server for this Flex Component. + /// The maximum storage that can be enabled on the Storage Server for this Flex Component. + /// The runtime minimum number of CPU cores that can be enabled for this Flex Component. + /// The name of the DB system shape for this Flex Component. + /// The maximum memory size that can be enabled on the DB Server for this Flex Component. + /// The maximum local storage that can be enabled on the DB Server for this Flex Component. + /// The compute model of the DB Server for this Flex Component. + /// The hardware type of the DB (Compute) or Storage (Cell) Server for this Flex Component. + /// The description summary for this Flex Component. + /// A new instance for mocking. + public static FlexComponentProperties FlexComponentProperties(int? minimumCoreCount = null, int? availableCoreCount = null, int? availableDBStorageInGbs = null, int? runtimeMinimumCoreCount = null, string shape = null, int? availableMemoryInGbs = null, int? availableLocalStorageInGbs = null, string computeModel = null, HardwareType? hardwareType = null, string descriptionSummary = null) + { + return new FlexComponentProperties( + minimumCoreCount, + availableCoreCount, + availableDBStorageInGbs, + runtimeMinimumCoreCount, + shape, + availableMemoryInGbs, + availableLocalStorageInGbs, + computeModel, + hardwareType, + descriptionSummary, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -830,6 +1032,24 @@ public static OracleGIVersionData OracleGIVersionData(ResourceIdentifier id = nu 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 GiMinorVersionData GiMinorVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, GiMinorVersionProperties properties = null) + { + return new GiMinorVersionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -876,9 +1096,14 @@ public static OracleSubscriptionData OracleSubscriptionData(ResourceIdentifier i /// Term Unit. P1Y, P3Y, etc, see Durations https://en.wikipedia.org/wiki/ISO_8601. /// Product code for the term unit. /// Intent for the update operation. + /// Azure subscriptions to be added. + /// State of the add Azure subscription operation on Oracle subscription. + /// Status details of the last operation on Oracle subscription. /// A new instance for mocking. - public static OracleSubscriptionProperties OracleSubscriptionProperties(OracleSubscriptionProvisioningState? provisioningState = null, string saasSubscriptionId = null, ResourceIdentifier cloudAccountId = null, CloudAccountProvisioningState? cloudAccountState = null, string termUnit = null, string productCode = null, OracleSubscriptionUpdateIntent? intent = null) + public static OracleSubscriptionProperties OracleSubscriptionProperties(OracleSubscriptionProvisioningState? provisioningState = null, string saasSubscriptionId = null, ResourceIdentifier cloudAccountId = null, CloudAccountProvisioningState? cloudAccountState = null, string termUnit = null, string productCode = null, OracleSubscriptionUpdateIntent? intent = null, IEnumerable azureSubscriptionIds = null, AddSubscriptionOperationState? addSubscriptionOperationState = null, string lastOperationStatusDetail = null) { + azureSubscriptionIds ??= new List(); + return new OracleSubscriptionProperties( provisioningState, saasSubscriptionId, @@ -887,6 +1112,9 @@ public static OracleSubscriptionProperties OracleSubscriptionProperties(OracleSu termUnit, productCode, intent, + azureSubscriptionIds?.ToList(), + addSubscriptionOperationState, + lastOperationStatusDetail, serializedAdditionalRawData: null); } @@ -968,7 +1196,7 @@ public static AutonomousDatabaseBackupData AutonomousDatabaseBackupData(Resource /// Indicates whether the backup can be used to restore the associated Autonomous Database. /// Additional information about the current lifecycle state. /// The current state of the backup. - /// Retention period, in days, for long-term backups. + /// Retention period, in days. /// The backup size in terabytes (TB). /// Timestamp until when the backup will be available. /// The date and time the backup started. @@ -998,6 +1226,24 @@ public static AutonomousDatabaseBackupProperties AutonomousDatabaseBackupPropert 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 AutonomousDatabaseBackupPatch AutonomousDatabaseBackupPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AutonomousDatabaseBackupProperties properties = null) + { + return new AutonomousDatabaseBackupPatch( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The type of wallet to generate. /// True when requesting regional connection strings in PDB connect info, applicable to cross-region DG only. @@ -1055,8 +1301,9 @@ public static OracleDBServerData OracleDBServerData(ResourceIdentifier id = null /// The shape of the Db server. The shape determines the amount of CPU, storage, and memory resources available. /// The date and time that the Db Server was created. /// Azure resource provisioning state. + /// The compute model of the Exadata Infrastructure. /// A new instance for mocking. - public static OracleDBServerProperties OracleDBServerProperties(ResourceIdentifier ocid = null, string displayName = null, ResourceIdentifier compartmentId = null, ResourceIdentifier exadataInfrastructureId = null, int? cpuCoreCount = null, DBServerPatchingDetails dbServerPatchingDetails = null, int? maxMemoryInGbs = null, int? dbNodeStorageSizeInGbs = null, IEnumerable vmClusterIds = null, IEnumerable dbNodeIds = null, string lifecycleDetails = null, DBServerProvisioningState? lifecycleState = null, int? maxCpuCount = null, IEnumerable autonomousVmClusterIds = null, IEnumerable autonomousVirtualMachineIds = null, int? maxDBNodeStorageInGbs = null, int? memorySizeInGbs = null, string shape = null, DateTimeOffset? createdOn = null, OracleDatabaseResourceProvisioningState? provisioningState = null) + public static OracleDBServerProperties OracleDBServerProperties(ResourceIdentifier ocid = null, string displayName = null, ResourceIdentifier compartmentId = null, ResourceIdentifier exadataInfrastructureId = null, int? cpuCoreCount = null, DBServerPatchingDetails dbServerPatchingDetails = null, int? maxMemoryInGbs = null, int? dbNodeStorageSizeInGbs = null, IEnumerable vmClusterIds = null, IEnumerable dbNodeIds = null, string lifecycleDetails = null, DBServerProvisioningState? lifecycleState = null, int? maxCpuCount = null, IEnumerable autonomousVmClusterIds = null, IEnumerable autonomousVirtualMachineIds = null, int? maxDBNodeStorageInGbs = null, int? memorySizeInGbs = null, string shape = null, DateTimeOffset? createdOn = null, OracleDatabaseResourceProvisioningState? provisioningState = null, AutonomousDatabaseComputeModel? computeModel = null) { vmClusterIds ??= new List(); dbNodeIds ??= new List(); @@ -1084,6 +1331,7 @@ public static OracleDBServerProperties OracleDBServerProperties(ResourceIdentifi shape, createdOn, provisioningState, + computeModel, serializedAdditionalRawData: null); } @@ -1141,7 +1389,7 @@ public static CloudVmClusterDBNodeData CloudVmClusterDBNodeData(ResourceIdentifi /// The OCID of the VNIC. /// Azure resource provisioning state. /// A new instance for mocking. - public static CloudVmClusterDBNodeProperties CloudVmClusterDBNodeProperties(ResourceIdentifier ocid = null, string additionalDetails = null, ResourceIdentifier backupIPId = null, ResourceIdentifier backupVnic2Id = null, ResourceIdentifier backupVnicId = null, int? cpuCoreCount = null, int? dbNodeStorageSizeInGbs = null, ResourceIdentifier dbServerId = null, ResourceIdentifier dbSystemId = null, string faultDomain = null, ResourceIdentifier hostIPId = null, string hostname = null, DBNodeProvisioningState? lifecycleState = null, string lifecycleDetails = null, DBNodeMaintenanceType? maintenanceType = null, int? memorySizeInGbs = null, int? softwareStorageSizeInGb = null, DateTimeOffset? timeCreated = null, DateTimeOffset? timeMaintenanceWindowEnd = null, DateTimeOffset? timeMaintenanceWindowStart = null, ResourceIdentifier vnic2Id = null, ResourceIdentifier vnicId = null, OracleDatabaseResourceProvisioningState? provisioningState = null) + public static CloudVmClusterDBNodeProperties CloudVmClusterDBNodeProperties(ResourceIdentifier ocid = null, string additionalDetails = null, ResourceIdentifier backupIPId = null, ResourceIdentifier backupVnic2Id = null, ResourceIdentifier backupVnicId = null, int? cpuCoreCount = null, int? dbNodeStorageSizeInGbs = null, ResourceIdentifier dbServerId = null, ResourceIdentifier dbSystemId = null, string faultDomain = null, ResourceIdentifier hostIPId = null, string hostname = null, DBNodeProvisioningState lifecycleState = default, string lifecycleDetails = null, DBNodeMaintenanceType? maintenanceType = null, int? memorySizeInGbs = null, int? softwareStorageSizeInGb = null, DateTimeOffset timeCreated = default, DateTimeOffset? timeMaintenanceWindowEnd = null, DateTimeOffset? timeMaintenanceWindowStart = null, ResourceIdentifier vnic2Id = null, ResourceIdentifier vnicId = null, OracleDatabaseResourceProvisioningState? provisioningState = null) { return new CloudVmClusterDBNodeProperties( ocid, @@ -1230,6 +1478,32 @@ public static CloudVmClusterVirtualNetworkAddressProperties CloudVmClusterVirtua 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 ExascaleDBNodeData ExascaleDBNodeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ExascaleDBNodeProperties properties = null) + { + return new ExascaleDBNodeData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// ExascaleDbNode provisioning state. + /// A new instance for mocking. + public static DBActionResponse DBActionResponse(OracleDatabaseProvisioningState? provisioningState = null) + { + return new DBActionResponse(provisioningState, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Admin password. /// The maintenance schedule type of the Autonomous Database Serverless. @@ -1245,11 +1519,13 @@ public static CloudVmClusterVirtualNetworkAddressProperties CloudVmClusterVirtua /// The user-friendly name for the Autonomous Database. /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. /// Indicates if auto scaling is enabled for the Autonomous Database storage. - /// The list of [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs. - /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. /// Local Autonomous Disaster Recovery standby database details. /// Indicates the number of seconds of data loss for a Data Guard failover. /// Specifies if the Autonomous Database requires mTLS connections. @@ -1306,7 +1582,7 @@ public static CloudVmClusterVirtualNetworkAddressProperties CloudVmClusterVirtua /// Retention period, in days, for long-term backups. /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. /// The source of the database. - /// The Azure ID of the Autonomous Database that was cloned to create the current Autonomous Database. + /// The Azure resource ID of the Autonomous Database that was cloned to create the current Autonomous Database. /// The Autonomous Database clone type. /// Indicates if the refreshable clone can be reconnected to its source database. /// Indicates if the Autonomous Database is a refreshable clone. @@ -1314,7 +1590,7 @@ public static CloudVmClusterVirtualNetworkAddressProperties CloudVmClusterVirtua /// The refresh status of the clone. /// The time and date as an RFC3339 formatted string, e.g., 2022-01-01T12:00:00.000Z, to set the limit for a refreshable clone to be reconnected to its source database. /// A new instance for mocking. - public static AutonomousDatabaseCloneProperties AutonomousDatabaseCloneProperties(string adminPassword = null, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = null, string characterSet = null, float? computeCount = null, AutonomousDatabaseComputeModel? computeModel = null, int? cpuCoreCount = null, IEnumerable customerContacts = null, int? dataStorageSizeInTbs = null, int? dataStorageSizeInGbs = null, string dbVersion = null, AutonomousDatabaseWorkloadType? dbWorkload = null, string displayName = null, bool? isAutoScalingEnabled = null, bool? isAutoScalingForStorageEnabled = null, IEnumerable peerDBIds = null, string peerDBId = null, bool? isLocalDataGuardEnabled = null, bool? isRemoteDataGuardEnabled = null, DisasterRecoveryType? localDisasterRecoveryType = null, AutonomousDatabaseStandbySummary localStandbyDB = null, int? failedDataRecoveryInSeconds = null, bool? isMtlsConnectionRequired = null, bool? isPreviewVersionWithServiceTermsAccepted = null, OracleLicenseModel? licenseModel = null, string ncharacterSet = null, string lifecycleDetails = null, OracleDatabaseProvisioningState? provisioningState = null, AutonomousDatabaseLifecycleState? lifecycleState = null, ScheduledOperationsType scheduledOperations = null, string privateEndpointIP = null, string privateEndpointLabel = null, Uri ociUri = null, ResourceIdentifier subnetId = null, ResourceIdentifier vnetId = null, DateTimeOffset? createdOn = null, DateTimeOffset? maintenanceBeginOn = null, DateTimeOffset? maintenanceEndOn = null, double? actualUsedDataStorageSizeInTbs = null, double? allocatedStorageSizeInTbs = null, OracleApexDetailsType apexDetails = null, IEnumerable availableUpgradeVersions = null, AutonomousDatabaseConnectionStrings connectionStrings = null, AutonomousDatabaseConnectionUrls connectionUrls = null, DataSafeStatusType? dataSafeStatus = null, OracleDatabaseEditionType? databaseEdition = null, ResourceIdentifier autonomousDatabaseId = null, int? inMemoryAreaInGbs = null, DateTimeOffset? nextLongTermBackupCreatedOn = null, LongTermBackUpScheduleDetails longTermBackupSchedule = null, bool? isPreview = null, int? localAdgAutoFailoverMaxDataLossLimit = null, int? memoryPerOracleComputeUnitInGbs = null, AutonomousDatabaseModeType? openMode = null, OperationsInsightsStatusType? operationsInsightsStatus = null, AutonomousDatabasePermissionLevelType? permissionLevel = null, string privateEndpoint = null, IEnumerable provisionableCpus = null, DataGuardRoleType? role = null, Uri serviceConsoleUri = null, Uri sqlWebDeveloperUri = null, IEnumerable supportedRegionsToCloneTo = null, DateTimeOffset? dataGuardRoleChangedOn = null, DateTimeOffset? freeAutonomousDatabaseDeletedOn = null, string timeLocalDataGuardEnabled = null, DateTimeOffset? lastFailoverHappenedOn = null, DateTimeOffset? lastRefreshHappenedOn = null, DateTimeOffset? lastRefreshPointTimestamp = null, DateTimeOffset? lastSwitchoverHappenedOn = null, DateTimeOffset? freeAutonomousDatabaseStoppedOn = null, int? usedDataStorageSizeInGbs = null, int? usedDataStorageSizeInTbs = null, ResourceIdentifier ocid = null, int? backupRetentionPeriodInDays = null, IEnumerable whitelistedIPs = null, AutonomousDatabaseSourceType? source = null, ResourceIdentifier sourceId = null, AutonomousDatabaseCloneType cloneType = default, bool? isReconnectCloneEnabled = null, bool? isRefreshableClone = null, RefreshableModelType? refreshableModel = null, RefreshableStatusType? refreshableStatus = null, DateTimeOffset? reconnectCloneEnabledOn = null) + public static AutonomousDatabaseCloneProperties AutonomousDatabaseCloneProperties(string adminPassword = null, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = null, string characterSet = null, float? computeCount = null, AutonomousDatabaseComputeModel? computeModel = null, int? cpuCoreCount = null, IEnumerable customerContacts = null, int? dataStorageSizeInTbs = null, int? dataStorageSizeInGbs = null, string dbVersion = null, AutonomousDatabaseWorkloadType? dbWorkload = null, string displayName = null, bool? isAutoScalingEnabled = null, bool? isAutoScalingForStorageEnabled = null, IEnumerable peerDBIds = null, string peerDBId = null, bool? isLocalDataGuardEnabled = null, bool? isRemoteDataGuardEnabled = null, DisasterRecoveryType? localDisasterRecoveryType = null, DateTimeOffset? timeDisasterRecoveryRoleChanged = null, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = null, AutonomousDatabaseStandbySummary localStandbyDB = null, int? failedDataRecoveryInSeconds = null, bool? isMtlsConnectionRequired = null, bool? isPreviewVersionWithServiceTermsAccepted = null, OracleLicenseModel? licenseModel = null, string ncharacterSet = null, string lifecycleDetails = null, OracleDatabaseProvisioningState? provisioningState = null, AutonomousDatabaseLifecycleState? lifecycleState = null, ScheduledOperationsType scheduledOperations = null, string privateEndpointIP = null, string privateEndpointLabel = null, Uri ociUri = null, ResourceIdentifier subnetId = null, ResourceIdentifier vnetId = null, DateTimeOffset? createdOn = null, DateTimeOffset? maintenanceBeginOn = null, DateTimeOffset? maintenanceEndOn = null, double? actualUsedDataStorageSizeInTbs = null, double? allocatedStorageSizeInTbs = null, OracleApexDetailsType apexDetails = null, IEnumerable availableUpgradeVersions = null, AutonomousDatabaseConnectionStrings connectionStrings = null, AutonomousDatabaseConnectionUrls connectionUrls = null, DataSafeStatusType? dataSafeStatus = null, OracleDatabaseEditionType? databaseEdition = null, ResourceIdentifier autonomousDatabaseId = null, int? inMemoryAreaInGbs = null, DateTimeOffset? nextLongTermBackupCreatedOn = null, LongTermBackUpScheduleDetails longTermBackupSchedule = null, bool? isPreview = null, int? localAdgAutoFailoverMaxDataLossLimit = null, int? memoryPerOracleComputeUnitInGbs = null, AutonomousDatabaseModeType? openMode = null, OperationsInsightsStatusType? operationsInsightsStatus = null, AutonomousDatabasePermissionLevelType? permissionLevel = null, string privateEndpoint = null, IEnumerable provisionableCpus = null, DataGuardRoleType? role = null, Uri serviceConsoleUri = null, Uri sqlWebDeveloperUri = null, IEnumerable supportedRegionsToCloneTo = null, DateTimeOffset? dataGuardRoleChangedOn = null, DateTimeOffset? freeAutonomousDatabaseDeletedOn = null, string timeLocalDataGuardEnabled = null, DateTimeOffset? lastFailoverHappenedOn = null, DateTimeOffset? lastRefreshHappenedOn = null, DateTimeOffset? lastRefreshPointTimestamp = null, DateTimeOffset? lastSwitchoverHappenedOn = null, DateTimeOffset? freeAutonomousDatabaseStoppedOn = null, int? usedDataStorageSizeInGbs = null, int? usedDataStorageSizeInTbs = null, ResourceIdentifier ocid = null, int? backupRetentionPeriodInDays = null, IEnumerable whitelistedIPs = null, AutonomousDatabaseSourceType? source = null, ResourceIdentifier sourceId = null, AutonomousDatabaseCloneType cloneType = default, bool? isReconnectCloneEnabled = null, bool? isRefreshableClone = null, RefreshableModelType? refreshableModel = null, RefreshableStatusType? refreshableStatus = null, DateTimeOffset? reconnectCloneEnabledOn = null) { customerContacts ??= new List(); peerDBIds ??= new List(); @@ -1344,6 +1620,8 @@ public static AutonomousDatabaseCloneProperties AutonomousDatabaseClonePropertie isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, localStandbyDB, failedDataRecoveryInSeconds, isMtlsConnectionRequired, @@ -1410,7 +1688,7 @@ public static AutonomousDatabaseCloneProperties AutonomousDatabaseClonePropertie reconnectCloneEnabledOn); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Admin password. /// The maintenance schedule type of the Autonomous Database Serverless. /// The character set for the autonomous database. @@ -1425,11 +1703,13 @@ public static AutonomousDatabaseCloneProperties AutonomousDatabaseClonePropertie /// The user-friendly name for the Autonomous Database. /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. /// Indicates if auto scaling is enabled for the Autonomous Database storage. - /// The list of [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs. - /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. /// Local Autonomous Disaster Recovery standby database details. /// Indicates the number of seconds of data loss for a Data Guard failover. /// Specifies if the Autonomous Database requires mTLS connections. @@ -1485,8 +1765,14 @@ public static AutonomousDatabaseCloneProperties AutonomousDatabaseClonePropertie /// Database ocid. /// Retention period, in days, for long-term backups. /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. - /// A new instance for mocking. - public static AutonomousDatabaseProperties AutonomousDatabaseProperties(string adminPassword = null, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = null, string characterSet = null, float? computeCount = null, AutonomousDatabaseComputeModel? computeModel = null, int? cpuCoreCount = null, IEnumerable customerContacts = null, int? dataStorageSizeInTbs = null, int? dataStorageSizeInGbs = null, string dbVersion = null, AutonomousDatabaseWorkloadType? dbWorkload = null, string displayName = null, bool? isAutoScalingEnabled = null, bool? isAutoScalingForStorageEnabled = null, IEnumerable peerDBIds = null, string peerDBId = null, bool? isLocalDataGuardEnabled = null, bool? isRemoteDataGuardEnabled = null, DisasterRecoveryType? localDisasterRecoveryType = null, AutonomousDatabaseStandbySummary localStandbyDB = null, int? failedDataRecoveryInSeconds = null, bool? isMtlsConnectionRequired = null, bool? isPreviewVersionWithServiceTermsAccepted = null, OracleLicenseModel? licenseModel = null, string ncharacterSet = null, string lifecycleDetails = null, OracleDatabaseProvisioningState? provisioningState = null, AutonomousDatabaseLifecycleState? lifecycleState = null, ScheduledOperationsType scheduledOperations = null, string privateEndpointIP = null, string privateEndpointLabel = null, Uri ociUri = null, ResourceIdentifier subnetId = null, ResourceIdentifier vnetId = null, DateTimeOffset? createdOn = null, DateTimeOffset? maintenanceBeginOn = null, DateTimeOffset? maintenanceEndOn = null, double? actualUsedDataStorageSizeInTbs = null, double? allocatedStorageSizeInTbs = null, OracleApexDetailsType apexDetails = null, IEnumerable availableUpgradeVersions = null, AutonomousDatabaseConnectionStrings connectionStrings = null, AutonomousDatabaseConnectionUrls connectionUrls = null, DataSafeStatusType? dataSafeStatus = null, OracleDatabaseEditionType? databaseEdition = null, ResourceIdentifier autonomousDatabaseId = null, int? inMemoryAreaInGbs = null, DateTimeOffset? nextLongTermBackupCreatedOn = null, LongTermBackUpScheduleDetails longTermBackupSchedule = null, bool? isPreview = null, int? localAdgAutoFailoverMaxDataLossLimit = null, int? memoryPerOracleComputeUnitInGbs = null, AutonomousDatabaseModeType? openMode = null, OperationsInsightsStatusType? operationsInsightsStatus = null, AutonomousDatabasePermissionLevelType? permissionLevel = null, string privateEndpoint = null, IEnumerable provisionableCpus = null, DataGuardRoleType? role = null, Uri serviceConsoleUri = null, Uri sqlWebDeveloperUri = null, IEnumerable supportedRegionsToCloneTo = null, DateTimeOffset? dataGuardRoleChangedOn = null, DateTimeOffset? freeAutonomousDatabaseDeletedOn = null, string timeLocalDataGuardEnabled = null, DateTimeOffset? lastFailoverHappenedOn = null, DateTimeOffset? lastRefreshHappenedOn = null, DateTimeOffset? lastRefreshPointTimestamp = null, DateTimeOffset? lastSwitchoverHappenedOn = null, DateTimeOffset? freeAutonomousDatabaseStoppedOn = null, int? usedDataStorageSizeInGbs = null, int? usedDataStorageSizeInTbs = null, ResourceIdentifier ocid = null, int? backupRetentionPeriodInDays = null, IEnumerable whitelistedIPs = null) + /// The source of the database. + /// The Azure ID of the source Autonomous Database that will be used to create a new peer database for the DR association. + /// The name of the region where source Autonomous Database exists. + /// The source database ocid. + /// Indicates the cross-region disaster recovery (DR) type of the standby Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the backups taken on the Primary are not replicated to the Standby database. + /// A new instance for mocking. + public static AutonomousDatabaseCrossRegionDisasterRecoveryProperties AutonomousDatabaseCrossRegionDisasterRecoveryProperties(string adminPassword = null, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = null, string characterSet = null, float? computeCount = null, AutonomousDatabaseComputeModel? computeModel = null, int? cpuCoreCount = null, IEnumerable customerContacts = null, int? dataStorageSizeInTbs = null, int? dataStorageSizeInGbs = null, string dbVersion = null, AutonomousDatabaseWorkloadType? dbWorkload = null, string displayName = null, bool? isAutoScalingEnabled = null, bool? isAutoScalingForStorageEnabled = null, IEnumerable peerDBIds = null, string peerDBId = null, bool? isLocalDataGuardEnabled = null, bool? isRemoteDataGuardEnabled = null, DisasterRecoveryType? localDisasterRecoveryType = null, DateTimeOffset? timeDisasterRecoveryRoleChanged = null, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = null, AutonomousDatabaseStandbySummary localStandbyDB = null, int? failedDataRecoveryInSeconds = null, bool? isMtlsConnectionRequired = null, bool? isPreviewVersionWithServiceTermsAccepted = null, OracleLicenseModel? licenseModel = null, string ncharacterSet = null, string lifecycleDetails = null, OracleDatabaseProvisioningState? provisioningState = null, AutonomousDatabaseLifecycleState? lifecycleState = null, ScheduledOperationsType scheduledOperations = null, string privateEndpointIP = null, string privateEndpointLabel = null, Uri ociUri = null, ResourceIdentifier subnetId = null, ResourceIdentifier vnetId = null, DateTimeOffset? createdOn = null, DateTimeOffset? maintenanceBeginOn = null, DateTimeOffset? maintenanceEndOn = null, double? actualUsedDataStorageSizeInTbs = null, double? allocatedStorageSizeInTbs = null, OracleApexDetailsType apexDetails = null, IEnumerable availableUpgradeVersions = null, AutonomousDatabaseConnectionStrings connectionStrings = null, AutonomousDatabaseConnectionUrls connectionUrls = null, DataSafeStatusType? dataSafeStatus = null, OracleDatabaseEditionType? databaseEdition = null, ResourceIdentifier autonomousDatabaseId = null, int? inMemoryAreaInGbs = null, DateTimeOffset? nextLongTermBackupCreatedOn = null, LongTermBackUpScheduleDetails longTermBackupSchedule = null, bool? isPreview = null, int? localAdgAutoFailoverMaxDataLossLimit = null, int? memoryPerOracleComputeUnitInGbs = null, AutonomousDatabaseModeType? openMode = null, OperationsInsightsStatusType? operationsInsightsStatus = null, AutonomousDatabasePermissionLevelType? permissionLevel = null, string privateEndpoint = null, IEnumerable provisionableCpus = null, DataGuardRoleType? role = null, Uri serviceConsoleUri = null, Uri sqlWebDeveloperUri = null, IEnumerable supportedRegionsToCloneTo = null, DateTimeOffset? dataGuardRoleChangedOn = null, DateTimeOffset? freeAutonomousDatabaseDeletedOn = null, string timeLocalDataGuardEnabled = null, DateTimeOffset? lastFailoverHappenedOn = null, DateTimeOffset? lastRefreshHappenedOn = null, DateTimeOffset? lastRefreshPointTimestamp = null, DateTimeOffset? lastSwitchoverHappenedOn = null, DateTimeOffset? freeAutonomousDatabaseStoppedOn = null, int? usedDataStorageSizeInGbs = null, int? usedDataStorageSizeInTbs = null, ResourceIdentifier ocid = null, int? backupRetentionPeriodInDays = null, IEnumerable whitelistedIPs = null, AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource source = default, ResourceIdentifier sourceId = null, string sourceLocation = null, string sourceOcid = null, DisasterRecoveryType remoteDisasterRecoveryType = default, bool? isReplicateAutomaticBackups = null) { customerContacts ??= new List(); peerDBIds ??= new List(); @@ -1495,9 +1781,9 @@ public static AutonomousDatabaseProperties AutonomousDatabaseProperties(string a supportedRegionsToCloneTo ??= new List(); whitelistedIPs ??= new List(); - return new AutonomousDatabaseProperties( + return new AutonomousDatabaseCrossRegionDisasterRecoveryProperties( adminPassword, - OracleDataBaseType.Regular, + OracleDataBaseType.CrossRegionDisasterRecovery, autonomousMaintenanceScheduleType, characterSet, computeCount, @@ -1516,6 +1802,8 @@ public static AutonomousDatabaseProperties AutonomousDatabaseProperties(string a isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, localStandbyDB, failedDataRecoveryInSeconds, isMtlsConnectionRequired, @@ -1571,7 +1859,752 @@ public static AutonomousDatabaseProperties AutonomousDatabaseProperties(string a ocid, backupRetentionPeriodInDays, whitelistedIPs?.ToList(), - serializedAdditionalRawData: null); + serializedAdditionalRawData: null, + source, + sourceId, + sourceLocation, + sourceOcid, + remoteDisasterRecoveryType, + isReplicateAutomaticBackups); + } + + /// Initializes a new instance of . + /// Admin password. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// The source of the database. + /// The ID of the source Autonomous Database that you will clone to create a new Autonomous Database. + /// The Autonomous Database clone type. + /// The timestamp specified for the point-in-time clone of the source Autonomous Database. The timestamp must be in the past. + /// Clone from latest available backup timestamp. + /// A new instance for mocking. + public static AutonomousDatabaseFromBackupTimestampProperties AutonomousDatabaseFromBackupTimestampProperties(string adminPassword = null, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = null, string characterSet = null, float? computeCount = null, AutonomousDatabaseComputeModel? computeModel = null, int? cpuCoreCount = null, IEnumerable customerContacts = null, int? dataStorageSizeInTbs = null, int? dataStorageSizeInGbs = null, string dbVersion = null, AutonomousDatabaseWorkloadType? dbWorkload = null, string displayName = null, bool? isAutoScalingEnabled = null, bool? isAutoScalingForStorageEnabled = null, IEnumerable peerDBIds = null, string peerDBId = null, bool? isLocalDataGuardEnabled = null, bool? isRemoteDataGuardEnabled = null, DisasterRecoveryType? localDisasterRecoveryType = null, DateTimeOffset? timeDisasterRecoveryRoleChanged = null, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = null, AutonomousDatabaseStandbySummary localStandbyDB = null, int? failedDataRecoveryInSeconds = null, bool? isMtlsConnectionRequired = null, bool? isPreviewVersionWithServiceTermsAccepted = null, OracleLicenseModel? licenseModel = null, string ncharacterSet = null, string lifecycleDetails = null, OracleDatabaseProvisioningState? provisioningState = null, AutonomousDatabaseLifecycleState? lifecycleState = null, ScheduledOperationsType scheduledOperations = null, string privateEndpointIP = null, string privateEndpointLabel = null, Uri ociUri = null, ResourceIdentifier subnetId = null, ResourceIdentifier vnetId = null, DateTimeOffset? createdOn = null, DateTimeOffset? maintenanceBeginOn = null, DateTimeOffset? maintenanceEndOn = null, double? actualUsedDataStorageSizeInTbs = null, double? allocatedStorageSizeInTbs = null, OracleApexDetailsType apexDetails = null, IEnumerable availableUpgradeVersions = null, AutonomousDatabaseConnectionStrings connectionStrings = null, AutonomousDatabaseConnectionUrls connectionUrls = null, DataSafeStatusType? dataSafeStatus = null, OracleDatabaseEditionType? databaseEdition = null, ResourceIdentifier autonomousDatabaseId = null, int? inMemoryAreaInGbs = null, DateTimeOffset? nextLongTermBackupCreatedOn = null, LongTermBackUpScheduleDetails longTermBackupSchedule = null, bool? isPreview = null, int? localAdgAutoFailoverMaxDataLossLimit = null, int? memoryPerOracleComputeUnitInGbs = null, AutonomousDatabaseModeType? openMode = null, OperationsInsightsStatusType? operationsInsightsStatus = null, AutonomousDatabasePermissionLevelType? permissionLevel = null, string privateEndpoint = null, IEnumerable provisionableCpus = null, DataGuardRoleType? role = null, Uri serviceConsoleUri = null, Uri sqlWebDeveloperUri = null, IEnumerable supportedRegionsToCloneTo = null, DateTimeOffset? dataGuardRoleChangedOn = null, DateTimeOffset? freeAutonomousDatabaseDeletedOn = null, string timeLocalDataGuardEnabled = null, DateTimeOffset? lastFailoverHappenedOn = null, DateTimeOffset? lastRefreshHappenedOn = null, DateTimeOffset? lastRefreshPointTimestamp = null, DateTimeOffset? lastSwitchoverHappenedOn = null, DateTimeOffset? freeAutonomousDatabaseStoppedOn = null, int? usedDataStorageSizeInGbs = null, int? usedDataStorageSizeInTbs = null, ResourceIdentifier ocid = null, int? backupRetentionPeriodInDays = null, IEnumerable whitelistedIPs = null, AutonomousDatabaseFromBackupTimestampPropertiesSource source = default, ResourceIdentifier sourceId = null, AutonomousDatabaseCloneType cloneType = default, DateTimeOffset? timestamp = null, bool? useLatestAvailableBackupTimeStamp = null) + { + customerContacts ??= new List(); + peerDBIds ??= new List(); + availableUpgradeVersions ??= new List(); + provisionableCpus ??= new List(); + supportedRegionsToCloneTo ??= new List(); + whitelistedIPs ??= new List(); + + return new AutonomousDatabaseFromBackupTimestampProperties( + adminPassword, + OracleDataBaseType.CloneFromBackupTimestamp, + autonomousMaintenanceScheduleType, + characterSet, + computeCount, + computeModel, + cpuCoreCount, + customerContacts?.ToList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + dbVersion, + dbWorkload, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDBIds?.ToList(), + peerDBId, + isLocalDataGuardEnabled, + isRemoteDataGuardEnabled, + localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, + localStandbyDB, + failedDataRecoveryInSeconds, + isMtlsConnectionRequired, + isPreviewVersionWithServiceTermsAccepted, + licenseModel, + ncharacterSet, + lifecycleDetails, + provisioningState, + lifecycleState, + scheduledOperations, + privateEndpointIP, + privateEndpointLabel, + ociUri, + subnetId, + vnetId, + createdOn, + maintenanceBeginOn, + maintenanceEndOn, + actualUsedDataStorageSizeInTbs, + allocatedStorageSizeInTbs, + apexDetails, + availableUpgradeVersions?.ToList(), + connectionStrings, + connectionUrls, + dataSafeStatus, + databaseEdition, + autonomousDatabaseId, + inMemoryAreaInGbs, + nextLongTermBackupCreatedOn, + longTermBackupSchedule, + isPreview, + localAdgAutoFailoverMaxDataLossLimit, + memoryPerOracleComputeUnitInGbs, + openMode, + operationsInsightsStatus, + permissionLevel, + privateEndpoint, + provisionableCpus?.ToList(), + role, + serviceConsoleUri, + sqlWebDeveloperUri, + supportedRegionsToCloneTo?.ToList(), + dataGuardRoleChangedOn, + freeAutonomousDatabaseDeletedOn, + timeLocalDataGuardEnabled, + lastFailoverHappenedOn, + lastRefreshHappenedOn, + lastRefreshPointTimestamp, + lastSwitchoverHappenedOn, + freeAutonomousDatabaseStoppedOn, + usedDataStorageSizeInGbs, + usedDataStorageSizeInTbs, + ocid, + backupRetentionPeriodInDays, + whitelistedIPs?.ToList(), + serializedAdditionalRawData: null, + source, + sourceId, + cloneType, + timestamp, + useLatestAvailableBackupTimeStamp); + } + + /// Initializes a new instance of . + /// Admin password. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// A new instance for mocking. + public static AutonomousDatabaseProperties AutonomousDatabaseProperties(string adminPassword = null, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = null, string characterSet = null, float? computeCount = null, AutonomousDatabaseComputeModel? computeModel = null, int? cpuCoreCount = null, IEnumerable customerContacts = null, int? dataStorageSizeInTbs = null, int? dataStorageSizeInGbs = null, string dbVersion = null, AutonomousDatabaseWorkloadType? dbWorkload = null, string displayName = null, bool? isAutoScalingEnabled = null, bool? isAutoScalingForStorageEnabled = null, IEnumerable peerDBIds = null, string peerDBId = null, bool? isLocalDataGuardEnabled = null, bool? isRemoteDataGuardEnabled = null, DisasterRecoveryType? localDisasterRecoveryType = null, DateTimeOffset? timeDisasterRecoveryRoleChanged = null, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = null, AutonomousDatabaseStandbySummary localStandbyDB = null, int? failedDataRecoveryInSeconds = null, bool? isMtlsConnectionRequired = null, bool? isPreviewVersionWithServiceTermsAccepted = null, OracleLicenseModel? licenseModel = null, string ncharacterSet = null, string lifecycleDetails = null, OracleDatabaseProvisioningState? provisioningState = null, AutonomousDatabaseLifecycleState? lifecycleState = null, ScheduledOperationsType scheduledOperations = null, string privateEndpointIP = null, string privateEndpointLabel = null, Uri ociUri = null, ResourceIdentifier subnetId = null, ResourceIdentifier vnetId = null, DateTimeOffset? createdOn = null, DateTimeOffset? maintenanceBeginOn = null, DateTimeOffset? maintenanceEndOn = null, double? actualUsedDataStorageSizeInTbs = null, double? allocatedStorageSizeInTbs = null, OracleApexDetailsType apexDetails = null, IEnumerable availableUpgradeVersions = null, AutonomousDatabaseConnectionStrings connectionStrings = null, AutonomousDatabaseConnectionUrls connectionUrls = null, DataSafeStatusType? dataSafeStatus = null, OracleDatabaseEditionType? databaseEdition = null, ResourceIdentifier autonomousDatabaseId = null, int? inMemoryAreaInGbs = null, DateTimeOffset? nextLongTermBackupCreatedOn = null, LongTermBackUpScheduleDetails longTermBackupSchedule = null, bool? isPreview = null, int? localAdgAutoFailoverMaxDataLossLimit = null, int? memoryPerOracleComputeUnitInGbs = null, AutonomousDatabaseModeType? openMode = null, OperationsInsightsStatusType? operationsInsightsStatus = null, AutonomousDatabasePermissionLevelType? permissionLevel = null, string privateEndpoint = null, IEnumerable provisionableCpus = null, DataGuardRoleType? role = null, Uri serviceConsoleUri = null, Uri sqlWebDeveloperUri = null, IEnumerable supportedRegionsToCloneTo = null, DateTimeOffset? dataGuardRoleChangedOn = null, DateTimeOffset? freeAutonomousDatabaseDeletedOn = null, string timeLocalDataGuardEnabled = null, DateTimeOffset? lastFailoverHappenedOn = null, DateTimeOffset? lastRefreshHappenedOn = null, DateTimeOffset? lastRefreshPointTimestamp = null, DateTimeOffset? lastSwitchoverHappenedOn = null, DateTimeOffset? freeAutonomousDatabaseStoppedOn = null, int? usedDataStorageSizeInGbs = null, int? usedDataStorageSizeInTbs = null, ResourceIdentifier ocid = null, int? backupRetentionPeriodInDays = null, IEnumerable whitelistedIPs = null) + { + customerContacts ??= new List(); + peerDBIds ??= new List(); + availableUpgradeVersions ??= new List(); + provisionableCpus ??= new List(); + supportedRegionsToCloneTo ??= new List(); + whitelistedIPs ??= new List(); + + return new AutonomousDatabaseProperties( + adminPassword, + OracleDataBaseType.Regular, + autonomousMaintenanceScheduleType, + characterSet, + computeCount, + computeModel, + cpuCoreCount, + customerContacts?.ToList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + dbVersion, + dbWorkload, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDBIds?.ToList(), + peerDBId, + isLocalDataGuardEnabled, + isRemoteDataGuardEnabled, + localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, + localStandbyDB, + failedDataRecoveryInSeconds, + isMtlsConnectionRequired, + isPreviewVersionWithServiceTermsAccepted, + licenseModel, + ncharacterSet, + lifecycleDetails, + provisioningState, + lifecycleState, + scheduledOperations, + privateEndpointIP, + privateEndpointLabel, + ociUri, + subnetId, + vnetId, + createdOn, + maintenanceBeginOn, + maintenanceEndOn, + actualUsedDataStorageSizeInTbs, + allocatedStorageSizeInTbs, + apexDetails, + availableUpgradeVersions?.ToList(), + connectionStrings, + connectionUrls, + dataSafeStatus, + databaseEdition, + autonomousDatabaseId, + inMemoryAreaInGbs, + nextLongTermBackupCreatedOn, + longTermBackupSchedule, + isPreview, + localAdgAutoFailoverMaxDataLossLimit, + memoryPerOracleComputeUnitInGbs, + openMode, + operationsInsightsStatus, + permissionLevel, + privateEndpoint, + provisionableCpus?.ToList(), + role, + serviceConsoleUri, + sqlWebDeveloperUri, + supportedRegionsToCloneTo?.ToList(), + dataGuardRoleChangedOn, + freeAutonomousDatabaseDeletedOn, + timeLocalDataGuardEnabled, + lastFailoverHappenedOn, + lastRefreshHappenedOn, + lastRefreshPointTimestamp, + lastSwitchoverHappenedOn, + freeAutonomousDatabaseStoppedOn, + usedDataStorageSizeInGbs, + usedDataStorageSizeInTbs, + ocid, + backupRetentionPeriodInDays, + whitelistedIPs?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Admin password. + /// Database type to be created. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs. + /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AutonomousDatabaseBaseProperties AutonomousDatabaseBaseProperties(string adminPassword, string dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, AutonomousDatabaseComputeModel? computeModel, int? cpuCoreCount, IEnumerable customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, AutonomousDatabaseWorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IEnumerable peerDBIds, string peerDBId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, AutonomousDatabaseStandbySummary localStandbyDB, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, OracleLicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, OracleDatabaseProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, Uri ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? createdOn, DateTimeOffset? maintenanceBeginOn, DateTimeOffset? maintenanceEndOn, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, OracleApexDetailsType apexDetails, IEnumerable availableUpgradeVersions, AutonomousDatabaseConnectionStrings connectionStrings, AutonomousDatabaseConnectionUrls connectionUrls, DataSafeStatusType? dataSafeStatus, OracleDatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupCreatedOn, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, AutonomousDatabaseModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, AutonomousDatabasePermissionLevelType? permissionLevel, string privateEndpoint, IEnumerable provisionableCpus, DataGuardRoleType? role, Uri serviceConsoleUri, Uri sqlWebDeveloperUri, IEnumerable supportedRegionsToCloneTo, DateTimeOffset? dataGuardRoleChangedOn, DateTimeOffset? freeAutonomousDatabaseDeletedOn, string timeLocalDataGuardEnabled, DateTimeOffset? lastFailoverHappenedOn, DateTimeOffset? lastRefreshHappenedOn, DateTimeOffset? lastRefreshPointTimestamp, DateTimeOffset? lastSwitchoverHappenedOn, DateTimeOffset? freeAutonomousDatabaseStoppedOn, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, ResourceIdentifier ocid, int? backupRetentionPeriodInDays, IEnumerable whitelistedIPs) + { + return AutonomousDatabaseBaseProperties(adminPassword: adminPassword, dataBaseType: dataBaseType, autonomousMaintenanceScheduleType: autonomousMaintenanceScheduleType, characterSet: characterSet, computeCount: computeCount, computeModel: computeModel, cpuCoreCount: cpuCoreCount, customerContacts: customerContacts, dataStorageSizeInTbs: dataStorageSizeInTbs, dataStorageSizeInGbs: dataStorageSizeInGbs, dbVersion: dbVersion, dbWorkload: dbWorkload, displayName: displayName, isAutoScalingEnabled: isAutoScalingEnabled, isAutoScalingForStorageEnabled: isAutoScalingForStorageEnabled, peerDBIds: peerDBIds, peerDBId: peerDBId, isLocalDataGuardEnabled: isLocalDataGuardEnabled, isRemoteDataGuardEnabled: isRemoteDataGuardEnabled, localDisasterRecoveryType: localDisasterRecoveryType, timeDisasterRecoveryRoleChanged: default, remoteDisasterRecoveryConfiguration: default, localStandbyDB: localStandbyDB, failedDataRecoveryInSeconds: failedDataRecoveryInSeconds, isMtlsConnectionRequired: isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted: isPreviewVersionWithServiceTermsAccepted, licenseModel: licenseModel, ncharacterSet: ncharacterSet, lifecycleDetails: lifecycleDetails, provisioningState: provisioningState, lifecycleState: lifecycleState, scheduledOperations: scheduledOperations, privateEndpointIP: privateEndpointIP, privateEndpointLabel: privateEndpointLabel, ociUri: ociUri, subnetId: subnetId, vnetId: vnetId, createdOn: createdOn, maintenanceBeginOn: maintenanceBeginOn, maintenanceEndOn: maintenanceEndOn, actualUsedDataStorageSizeInTbs: actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs: allocatedStorageSizeInTbs, apexDetails: apexDetails, availableUpgradeVersions: availableUpgradeVersions, connectionStrings: connectionStrings, connectionUrls: connectionUrls, dataSafeStatus: dataSafeStatus, databaseEdition: databaseEdition, autonomousDatabaseId: autonomousDatabaseId, inMemoryAreaInGbs: inMemoryAreaInGbs, nextLongTermBackupCreatedOn: nextLongTermBackupCreatedOn, longTermBackupSchedule: longTermBackupSchedule, isPreview: isPreview, localAdgAutoFailoverMaxDataLossLimit: localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs: memoryPerOracleComputeUnitInGbs, openMode: openMode, operationsInsightsStatus: operationsInsightsStatus, permissionLevel: permissionLevel, privateEndpoint: privateEndpoint, provisionableCpus: provisionableCpus, role: role, serviceConsoleUri: serviceConsoleUri, sqlWebDeveloperUri: sqlWebDeveloperUri, supportedRegionsToCloneTo: supportedRegionsToCloneTo, dataGuardRoleChangedOn: dataGuardRoleChangedOn, freeAutonomousDatabaseDeletedOn: freeAutonomousDatabaseDeletedOn, timeLocalDataGuardEnabled: timeLocalDataGuardEnabled, lastFailoverHappenedOn: lastFailoverHappenedOn, lastRefreshHappenedOn: lastRefreshHappenedOn, lastRefreshPointTimestamp: lastRefreshPointTimestamp, lastSwitchoverHappenedOn: lastSwitchoverHappenedOn, freeAutonomousDatabaseStoppedOn: freeAutonomousDatabaseStoppedOn, usedDataStorageSizeInGbs: usedDataStorageSizeInGbs, usedDataStorageSizeInTbs: usedDataStorageSizeInTbs, ocid: ocid, backupRetentionPeriodInDays: backupRetentionPeriodInDays, whitelistedIPs: whitelistedIPs); + } + + /// Initializes a new instance of . + /// Exadata infra ocid. + /// The number of compute servers for the cloud Exadata infrastructure. + /// The number of storage servers for the cloud Exadata infrastructure. + /// The total storage allocated to the cloud Exadata infrastructure resource, in gigabytes (GB). + /// The available storage can be allocated to the cloud Exadata infrastructure resource, in gigabytes (GB). + /// The date and time the cloud Exadata infrastructure resource was created. + /// Additional information about the current lifecycle state. + /// maintenanceWindow property. + /// The estimated total time required in minutes for all patching operations (database server, storage server, and network switch patching). + /// The list of customer email addresses that receive information from Oracle about the specified OCI Database service resource. Oracle uses these email addresses to send notifications about planned and unplanned software maintenance updates, information about system hardware, and other information needed by administrators. Up to 10 email addresses can be added to the customer contacts for a cloud Exadata infrastructure instance. + /// CloudExadataInfrastructure provisioning state. + /// CloudExadataInfrastructure lifecycle state. + /// The model name of the cloud Exadata infrastructure resource. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// The total number of CPU cores allocated. + /// The total number of CPU cores available. + /// The memory allocated in GBs. + /// The total memory available in GBs. + /// The local node storage to be allocated in GBs. + /// The total local node storage available in GBs. + /// The quantity of data in the database, in terabytes. + /// The total available DATA disk group size. + /// The software version of the database servers (dom0) in the Exadata infrastructure. + /// The software version of the storage servers (cells) in the Exadata infrastructure. + /// The requested number of additional storage servers activated for the Exadata infrastructure. + /// The requested number of additional storage servers for the Exadata infrastructure. + /// The name for the Exadata infrastructure. + /// The OCID of the last maintenance run. + /// The OCID of the next maintenance run. + /// Monthly Db Server version. + /// Monthly Storage Server version. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static CloudExadataInfrastructureProperties CloudExadataInfrastructureProperties(ResourceIdentifier ocid, int? computeCount, int? storageCount, int? totalStorageSizeInGbs, int? availableStorageSizeInGbs, DateTimeOffset? createdOn, string lifecycleDetails, OracleDatabaseMaintenanceWindow maintenanceWindow, EstimatedPatchingTime estimatedPatchingTime, IEnumerable customerContacts, OracleDatabaseProvisioningState? provisioningState, CloudExadataInfrastructureLifecycleState? lifecycleState, string shape, Uri ociUri, int? cpuCount, int? maxCpuCount, int? memorySizeInGbs, int? maxMemoryInGbs, int? dbNodeStorageSizeInGbs, int? maxDBNodeStorageSizeInGbs, double? dataStorageSizeInTbs, double? maxDataStorageInTbs, string dbServerVersion, string storageServerVersion, int? activatedStorageCount, int? additionalStorageCount, string displayName, ResourceIdentifier lastMaintenanceRunId, ResourceIdentifier nextMaintenanceRunId, string monthlyDBServerVersion, string monthlyStorageServerVersion) + { + return CloudExadataInfrastructureProperties(definedFileSystemConfiguration: default, ocid: ocid, computeCount: computeCount, storageCount: storageCount, totalStorageSizeInGbs: totalStorageSizeInGbs, availableStorageSizeInGbs: availableStorageSizeInGbs, createdOn: createdOn, lifecycleDetails: lifecycleDetails, maintenanceWindow: maintenanceWindow, estimatedPatchingTime: estimatedPatchingTime, customerContacts: customerContacts, provisioningState: provisioningState, lifecycleState: lifecycleState, shape: shape, ociUri: ociUri, cpuCount: cpuCount, maxCpuCount: maxCpuCount, memorySizeInGbs: memorySizeInGbs, maxMemoryInGbs: maxMemoryInGbs, dbNodeStorageSizeInGbs: dbNodeStorageSizeInGbs, maxDBNodeStorageSizeInGbs: maxDBNodeStorageSizeInGbs, dataStorageSizeInTbs: dataStorageSizeInTbs, maxDataStorageInTbs: maxDataStorageInTbs, dbServerVersion: dbServerVersion, storageServerVersion: storageServerVersion, activatedStorageCount: activatedStorageCount, additionalStorageCount: additionalStorageCount, displayName: displayName, lastMaintenanceRunId: lastMaintenanceRunId, nextMaintenanceRunId: nextMaintenanceRunId, monthlyDBServerVersion: monthlyDBServerVersion, monthlyStorageServerVersion: monthlyStorageServerVersion, databaseServerType: default, storageServerType: default, computeModel: default); + } + + /// Initializes a new instance of . + /// Cloud VM Cluster ocid. + /// The port number configured for the listener on the cloud VM cluster. + /// The number of nodes in the cloud VM cluster. + /// The data disk group size to be allocated in GBs per VM. + /// The data disk group size to be allocated in TBs. + /// The local node storage to be allocated in GBs. + /// The memory to be allocated in GBs. + /// The date and time that the cloud VM cluster was created. + /// Additional information about the current lifecycle state. + /// The time zone of the cloud VM cluster. For details, see [Exadata Infrastructure Time Zones](/Content/Database/References/timezones.htm). + /// The OCID of the zone the cloud VM cluster is associated with. + /// The hostname for the cloud VM cluster. + /// The domain name for the cloud VM cluster. + /// The number of CPU cores enabled on the cloud VM cluster. + /// The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal place is allowed for the fractional part. + /// The cluster name for cloud VM cluster. The cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + /// The percentage assigned to DATA storage (user data and database files). The remaining percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager backups). Accepted values are 35, 40, 60 and 80. The default is 80 percent assigned to DATA storage. See [Storage Configuration](/Content/Database/Concepts/exaoverview.htm#Exadata) in the Exadata documentation for details on the impact of the configuration settings on storage. + /// If true, database backup on local Exadata storage is configured for the cloud VM cluster. If false, database backup on local Exadata storage is not available in the cloud VM cluster. + /// Cloud Exadata Infrastructure ID. + /// If true, sparse disk group is configured for the cloud VM cluster. If false, sparse disk group is not created. + /// Operating system version of the image. + /// The public key portion of one or more key pairs used for SSH access to the cloud VM cluster. + /// The Oracle license model that applies to the cloud VM cluster. The default is LICENSE_INCLUDED. + /// The type of redundancy configured for the cloud Vm cluster. NORMAL is 2-way redundancy. HIGH is 3-way redundancy. + /// The Single Client Access Name (SCAN) IP addresses associated with the cloud VM cluster. SCAN IP addresses are typically used for load balancing and are not assigned to any interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. **Note:** For a single-node DB system, this list is empty. + /// The virtual IP (VIP) addresses associated with the cloud VM cluster. The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata Cloud Service instance to enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. **Note:** For a single-node DB system, this list is empty. + /// The FQDN of the DNS record for the SCAN IP addresses that are associated with the cloud VM cluster. + /// The TCP Single Client Access Name (SCAN) port. The default port is 1521. + /// The TCPS Single Client Access Name (SCAN) port. The default port is 2484. + /// The OCID of the DNS record for the SCAN IP addresses that are associated with the cloud VM cluster. + /// The model name of the Exadata hardware running the cloud VM cluster. + /// CloudVmCluster provisioning state. + /// CloudVmCluster lifecycle state. + /// VNET for network connectivity. + /// Oracle Grid Infrastructure (GI) software version. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface. + /// Client subnet. + /// Client OCI backup subnet CIDR, default is 192.168.252.0/22. + /// CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster will be added by default. + /// Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + /// Display Name. + /// The list of compute servers to be added to the cloud VM cluster. + /// iormConfigCache details for cloud VM cluster. + /// The OCID of the last maintenance update history entry. + /// The list of DB servers. + /// Cluster compartmentId. + /// Cluster subnet ocid. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static CloudVmClusterProperties CloudVmClusterProperties(ResourceIdentifier ocid, long? listenerPort, int? nodeCount, int? storageSizeInGbs, double? dataStorageSizeInTbs, int? dbNodeStorageSizeInGbs, int? memorySizeInGbs, DateTimeOffset? createdOn, string lifecycleDetails, string timeZone, ResourceIdentifier zoneId, string hostname, string domain, int cpuCoreCount, float? ocpuCount, string clusterName, int? dataStoragePercentage, bool? isLocalBackupEnabled, ResourceIdentifier cloudExadataInfrastructureId, bool? isSparseDiskgroupEnabled, string systemVersion, IEnumerable sshPublicKeys, OracleLicenseModel? licenseModel, CloudVmClusterDiskRedundancy? diskRedundancy, IEnumerable scanIPIds, IEnumerable vipIds, string scanDnsName, int? scanListenerPortTcp, int? scanListenerPortTcpSsl, ResourceIdentifier scanDnsRecordId, string shape, OracleDatabaseProvisioningState? provisioningState, CloudVmClusterLifecycleState? lifecycleState, ResourceIdentifier vnetId, string giVersion, Uri ociUri, Uri nsgUri, ResourceIdentifier subnetId, string backupSubnetCidr, IEnumerable nsgCidrs, DiagnosticCollectionConfig dataCollectionOptions, string displayName, IEnumerable computeNodes, ExadataIormConfig iormConfigCache, ResourceIdentifier lastUpdateHistoryEntryId, IEnumerable dbServers, ResourceIdentifier compartmentId, ResourceIdentifier subnetOcid) + { + return CloudVmClusterProperties(ocid: ocid, listenerPort: listenerPort, nodeCount: nodeCount, storageSizeInGbs: storageSizeInGbs, fileSystemConfigurationDetails: default, dataStorageSizeInTbs: dataStorageSizeInTbs, dbNodeStorageSizeInGbs: dbNodeStorageSizeInGbs, memorySizeInGbs: memorySizeInGbs, createdOn: createdOn, lifecycleDetails: lifecycleDetails, timeZone: timeZone, zoneId: zoneId, hostname: hostname, domain: domain, cpuCoreCount: cpuCoreCount, ocpuCount: ocpuCount, clusterName: clusterName, dataStoragePercentage: dataStoragePercentage, isLocalBackupEnabled: isLocalBackupEnabled, cloudExadataInfrastructureId: cloudExadataInfrastructureId, isSparseDiskgroupEnabled: isSparseDiskgroupEnabled, systemVersion: systemVersion, sshPublicKeys: sshPublicKeys, licenseModel: licenseModel, diskRedundancy: diskRedundancy, scanIPIds: scanIPIds, vipIds: vipIds, scanDnsName: scanDnsName, scanListenerPortTcp: scanListenerPortTcp, scanListenerPortTcpSsl: scanListenerPortTcpSsl, scanDnsRecordId: scanDnsRecordId, shape: shape, provisioningState: provisioningState, lifecycleState: lifecycleState, vnetId: vnetId, giVersion: giVersion, ociUri: ociUri, nsgUri: nsgUri, subnetId: subnetId, backupSubnetCidr: backupSubnetCidr, nsgCidrs: nsgCidrs, dataCollectionOptions: dataCollectionOptions, displayName: displayName, computeNodes: computeNodes, iormConfigCache: iormConfigCache, lastUpdateHistoryEntryId: lastUpdateHistoryEntryId, dbServers: dbServers, compartmentId: compartmentId, subnetOcid: subnetOcid, computeModel: default); + } + + /// Initializes a new instance of . + /// OracleSubscriptionProvisioningState provisioning state. + /// SAAS subscription ID generated by Marketplace. + /// Cloud Account Id. + /// Cloud Account provisioning state. + /// Term Unit. P1Y, P3Y, etc, see Durations https://en.wikipedia.org/wiki/ISO_8601. + /// Product code for the term unit. + /// Intent for the update operation. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static OracleSubscriptionProperties OracleSubscriptionProperties(OracleSubscriptionProvisioningState? provisioningState, string saasSubscriptionId, ResourceIdentifier cloudAccountId, CloudAccountProvisioningState? cloudAccountState, string termUnit, string productCode, OracleSubscriptionUpdateIntent? intent) + { + return OracleSubscriptionProperties(provisioningState: provisioningState, saasSubscriptionId: saasSubscriptionId, cloudAccountId: cloudAccountId, cloudAccountState: cloudAccountState, termUnit: termUnit, productCode: productCode, intent: intent, azureSubscriptionIds: default, addSubscriptionOperationState: default, lastOperationStatusDetail: default); + } + + /// Initializes a new instance of . + /// Db server name. + /// The name for the Db Server. + /// The OCID of the compartment. + /// The OCID of the Exadata infrastructure. + /// The number of CPU cores enabled on the Db server. + /// dbServerPatching details of the Db server. + /// The total memory available in GBs. + /// The allocated local node storage in GBs on the Db server. + /// The OCID of the VM Clusters associated with the Db server. + /// The OCID of the Db nodes associated with the Db server. + /// Lifecycle details of dbServer. + /// DbServer provisioning state. + /// The total number of CPU cores available. + /// The list of OCIDs of the Autonomous VM Clusters associated with the Db server. + /// The list of OCIDs of the Autonomous Virtual Machines associated with the Db server. + /// The total max dbNode storage in GBs. + /// The total memory size in GBs. + /// The shape of the Db server. The shape determines the amount of CPU, storage, and memory resources available. + /// The date and time that the Db Server was created. + /// Azure resource provisioning state. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static OracleDBServerProperties OracleDBServerProperties(ResourceIdentifier ocid, string displayName, ResourceIdentifier compartmentId, ResourceIdentifier exadataInfrastructureId, int? cpuCoreCount, DBServerPatchingDetails dbServerPatchingDetails, int? maxMemoryInGbs, int? dbNodeStorageSizeInGbs, IEnumerable vmClusterIds, IEnumerable dbNodeIds, string lifecycleDetails, DBServerProvisioningState? lifecycleState, int? maxCpuCount, IEnumerable autonomousVmClusterIds, IEnumerable autonomousVirtualMachineIds, int? maxDBNodeStorageInGbs, int? memorySizeInGbs, string shape, DateTimeOffset? createdOn, OracleDatabaseResourceProvisioningState? provisioningState) + { + return OracleDBServerProperties(ocid: ocid, displayName: displayName, compartmentId: compartmentId, exadataInfrastructureId: exadataInfrastructureId, cpuCoreCount: cpuCoreCount, dbServerPatchingDetails: dbServerPatchingDetails, maxMemoryInGbs: maxMemoryInGbs, dbNodeStorageSizeInGbs: dbNodeStorageSizeInGbs, vmClusterIds: vmClusterIds, dbNodeIds: dbNodeIds, lifecycleDetails: lifecycleDetails, lifecycleState: lifecycleState, maxCpuCount: maxCpuCount, autonomousVmClusterIds: autonomousVmClusterIds, autonomousVirtualMachineIds: autonomousVirtualMachineIds, maxDBNodeStorageInGbs: maxDBNodeStorageInGbs, memorySizeInGbs: memorySizeInGbs, shape: shape, createdOn: createdOn, provisioningState: provisioningState, computeModel: default); + } + + /// Initializes a new instance of . + /// Admin password. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs. + /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// The source of the database. + /// The Azure ID of the Autonomous Database that was cloned to create the current Autonomous Database. + /// The Autonomous Database clone type. + /// Indicates if the refreshable clone can be reconnected to its source database. + /// Indicates if the Autonomous Database is a refreshable clone. + /// The refresh mode of the clone. + /// The refresh status of the clone. + /// The time and date as an RFC3339 formatted string, e.g., 2022-01-01T12:00:00.000Z, to set the limit for a refreshable clone to be reconnected to its source database. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AutonomousDatabaseCloneProperties AutonomousDatabaseCloneProperties(string adminPassword, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, AutonomousDatabaseComputeModel? computeModel, int? cpuCoreCount, IEnumerable customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, AutonomousDatabaseWorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IEnumerable peerDBIds, string peerDBId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, AutonomousDatabaseStandbySummary localStandbyDB, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, OracleLicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, OracleDatabaseProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, Uri ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? createdOn, DateTimeOffset? maintenanceBeginOn, DateTimeOffset? maintenanceEndOn, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, OracleApexDetailsType apexDetails, IEnumerable availableUpgradeVersions, AutonomousDatabaseConnectionStrings connectionStrings, AutonomousDatabaseConnectionUrls connectionUrls, DataSafeStatusType? dataSafeStatus, OracleDatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupCreatedOn, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, AutonomousDatabaseModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, AutonomousDatabasePermissionLevelType? permissionLevel, string privateEndpoint, IEnumerable provisionableCpus, DataGuardRoleType? role, Uri serviceConsoleUri, Uri sqlWebDeveloperUri, IEnumerable supportedRegionsToCloneTo, DateTimeOffset? dataGuardRoleChangedOn, DateTimeOffset? freeAutonomousDatabaseDeletedOn, string timeLocalDataGuardEnabled, DateTimeOffset? lastFailoverHappenedOn, DateTimeOffset? lastRefreshHappenedOn, DateTimeOffset? lastRefreshPointTimestamp, DateTimeOffset? lastSwitchoverHappenedOn, DateTimeOffset? freeAutonomousDatabaseStoppedOn, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, ResourceIdentifier ocid, int? backupRetentionPeriodInDays, IEnumerable whitelistedIPs, AutonomousDatabaseSourceType? source, ResourceIdentifier sourceId, AutonomousDatabaseCloneType cloneType, bool? isReconnectCloneEnabled, bool? isRefreshableClone, RefreshableModelType? refreshableModel, RefreshableStatusType? refreshableStatus, DateTimeOffset? reconnectCloneEnabledOn) + { + return AutonomousDatabaseCloneProperties(adminPassword: adminPassword, autonomousMaintenanceScheduleType: autonomousMaintenanceScheduleType, characterSet: characterSet, computeCount: computeCount, computeModel: computeModel, cpuCoreCount: cpuCoreCount, customerContacts: customerContacts, dataStorageSizeInTbs: dataStorageSizeInTbs, dataStorageSizeInGbs: dataStorageSizeInGbs, dbVersion: dbVersion, dbWorkload: dbWorkload, displayName: displayName, isAutoScalingEnabled: isAutoScalingEnabled, isAutoScalingForStorageEnabled: isAutoScalingForStorageEnabled, peerDBIds: peerDBIds, peerDBId: peerDBId, isLocalDataGuardEnabled: isLocalDataGuardEnabled, isRemoteDataGuardEnabled: isRemoteDataGuardEnabled, localDisasterRecoveryType: localDisasterRecoveryType, timeDisasterRecoveryRoleChanged: default, remoteDisasterRecoveryConfiguration: default, localStandbyDB: localStandbyDB, failedDataRecoveryInSeconds: failedDataRecoveryInSeconds, isMtlsConnectionRequired: isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted: isPreviewVersionWithServiceTermsAccepted, licenseModel: licenseModel, ncharacterSet: ncharacterSet, lifecycleDetails: lifecycleDetails, provisioningState: provisioningState, lifecycleState: lifecycleState, scheduledOperations: scheduledOperations, privateEndpointIP: privateEndpointIP, privateEndpointLabel: privateEndpointLabel, ociUri: ociUri, subnetId: subnetId, vnetId: vnetId, createdOn: createdOn, maintenanceBeginOn: maintenanceBeginOn, maintenanceEndOn: maintenanceEndOn, actualUsedDataStorageSizeInTbs: actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs: allocatedStorageSizeInTbs, apexDetails: apexDetails, availableUpgradeVersions: availableUpgradeVersions, connectionStrings: connectionStrings, connectionUrls: connectionUrls, dataSafeStatus: dataSafeStatus, databaseEdition: databaseEdition, autonomousDatabaseId: autonomousDatabaseId, inMemoryAreaInGbs: inMemoryAreaInGbs, nextLongTermBackupCreatedOn: nextLongTermBackupCreatedOn, longTermBackupSchedule: longTermBackupSchedule, isPreview: isPreview, localAdgAutoFailoverMaxDataLossLimit: localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs: memoryPerOracleComputeUnitInGbs, openMode: openMode, operationsInsightsStatus: operationsInsightsStatus, permissionLevel: permissionLevel, privateEndpoint: privateEndpoint, provisionableCpus: provisionableCpus, role: role, serviceConsoleUri: serviceConsoleUri, sqlWebDeveloperUri: sqlWebDeveloperUri, supportedRegionsToCloneTo: supportedRegionsToCloneTo, dataGuardRoleChangedOn: dataGuardRoleChangedOn, freeAutonomousDatabaseDeletedOn: freeAutonomousDatabaseDeletedOn, timeLocalDataGuardEnabled: timeLocalDataGuardEnabled, lastFailoverHappenedOn: lastFailoverHappenedOn, lastRefreshHappenedOn: lastRefreshHappenedOn, lastRefreshPointTimestamp: lastRefreshPointTimestamp, lastSwitchoverHappenedOn: lastSwitchoverHappenedOn, freeAutonomousDatabaseStoppedOn: freeAutonomousDatabaseStoppedOn, usedDataStorageSizeInGbs: usedDataStorageSizeInGbs, usedDataStorageSizeInTbs: usedDataStorageSizeInTbs, ocid: ocid, backupRetentionPeriodInDays: backupRetentionPeriodInDays, whitelistedIPs: whitelistedIPs, source: source, sourceId: sourceId, cloneType: cloneType, isReconnectCloneEnabled: isReconnectCloneEnabled, isRefreshableClone: isRefreshableClone, refreshableModel: refreshableModel, refreshableStatus: refreshableStatus, reconnectCloneEnabledOn: reconnectCloneEnabledOn); + } + + /// Initializes a new instance of . + /// Admin password. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs. + /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AutonomousDatabaseProperties AutonomousDatabaseProperties(string adminPassword, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, AutonomousDatabaseComputeModel? computeModel, int? cpuCoreCount, IEnumerable customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, AutonomousDatabaseWorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IEnumerable peerDBIds, string peerDBId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, AutonomousDatabaseStandbySummary localStandbyDB, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, OracleLicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, OracleDatabaseProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, Uri ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? createdOn, DateTimeOffset? maintenanceBeginOn, DateTimeOffset? maintenanceEndOn, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, OracleApexDetailsType apexDetails, IEnumerable availableUpgradeVersions, AutonomousDatabaseConnectionStrings connectionStrings, AutonomousDatabaseConnectionUrls connectionUrls, DataSafeStatusType? dataSafeStatus, OracleDatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupCreatedOn, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, AutonomousDatabaseModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, AutonomousDatabasePermissionLevelType? permissionLevel, string privateEndpoint, IEnumerable provisionableCpus, DataGuardRoleType? role, Uri serviceConsoleUri, Uri sqlWebDeveloperUri, IEnumerable supportedRegionsToCloneTo, DateTimeOffset? dataGuardRoleChangedOn, DateTimeOffset? freeAutonomousDatabaseDeletedOn, string timeLocalDataGuardEnabled, DateTimeOffset? lastFailoverHappenedOn, DateTimeOffset? lastRefreshHappenedOn, DateTimeOffset? lastRefreshPointTimestamp, DateTimeOffset? lastSwitchoverHappenedOn, DateTimeOffset? freeAutonomousDatabaseStoppedOn, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, ResourceIdentifier ocid, int? backupRetentionPeriodInDays, IEnumerable whitelistedIPs) + { + return AutonomousDatabaseProperties(adminPassword: adminPassword, autonomousMaintenanceScheduleType: autonomousMaintenanceScheduleType, characterSet: characterSet, computeCount: computeCount, computeModel: computeModel, cpuCoreCount: cpuCoreCount, customerContacts: customerContacts, dataStorageSizeInTbs: dataStorageSizeInTbs, dataStorageSizeInGbs: dataStorageSizeInGbs, dbVersion: dbVersion, dbWorkload: dbWorkload, displayName: displayName, isAutoScalingEnabled: isAutoScalingEnabled, isAutoScalingForStorageEnabled: isAutoScalingForStorageEnabled, peerDBIds: peerDBIds, peerDBId: peerDBId, isLocalDataGuardEnabled: isLocalDataGuardEnabled, isRemoteDataGuardEnabled: isRemoteDataGuardEnabled, localDisasterRecoveryType: localDisasterRecoveryType, timeDisasterRecoveryRoleChanged: default, remoteDisasterRecoveryConfiguration: default, localStandbyDB: localStandbyDB, failedDataRecoveryInSeconds: failedDataRecoveryInSeconds, isMtlsConnectionRequired: isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted: isPreviewVersionWithServiceTermsAccepted, licenseModel: licenseModel, ncharacterSet: ncharacterSet, lifecycleDetails: lifecycleDetails, provisioningState: provisioningState, lifecycleState: lifecycleState, scheduledOperations: scheduledOperations, privateEndpointIP: privateEndpointIP, privateEndpointLabel: privateEndpointLabel, ociUri: ociUri, subnetId: subnetId, vnetId: vnetId, createdOn: createdOn, maintenanceBeginOn: maintenanceBeginOn, maintenanceEndOn: maintenanceEndOn, actualUsedDataStorageSizeInTbs: actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs: allocatedStorageSizeInTbs, apexDetails: apexDetails, availableUpgradeVersions: availableUpgradeVersions, connectionStrings: connectionStrings, connectionUrls: connectionUrls, dataSafeStatus: dataSafeStatus, databaseEdition: databaseEdition, autonomousDatabaseId: autonomousDatabaseId, inMemoryAreaInGbs: inMemoryAreaInGbs, nextLongTermBackupCreatedOn: nextLongTermBackupCreatedOn, longTermBackupSchedule: longTermBackupSchedule, isPreview: isPreview, localAdgAutoFailoverMaxDataLossLimit: localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs: memoryPerOracleComputeUnitInGbs, openMode: openMode, operationsInsightsStatus: operationsInsightsStatus, permissionLevel: permissionLevel, privateEndpoint: privateEndpoint, provisionableCpus: provisionableCpus, role: role, serviceConsoleUri: serviceConsoleUri, sqlWebDeveloperUri: sqlWebDeveloperUri, supportedRegionsToCloneTo: supportedRegionsToCloneTo, dataGuardRoleChangedOn: dataGuardRoleChangedOn, freeAutonomousDatabaseDeletedOn: freeAutonomousDatabaseDeletedOn, timeLocalDataGuardEnabled: timeLocalDataGuardEnabled, lastFailoverHappenedOn: lastFailoverHappenedOn, lastRefreshHappenedOn: lastRefreshHappenedOn, lastRefreshPointTimestamp: lastRefreshPointTimestamp, lastSwitchoverHappenedOn: lastSwitchoverHappenedOn, freeAutonomousDatabaseStoppedOn: freeAutonomousDatabaseStoppedOn, usedDataStorageSizeInGbs: usedDataStorageSizeInGbs, usedDataStorageSizeInTbs: usedDataStorageSizeInTbs, ocid: ocid, backupRetentionPeriodInDays: backupRetentionPeriodInDays, whitelistedIPs: whitelistedIPs); } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDBVersionCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDBVersionCollection.cs index 3c3676a88ffe..8468bb3a3169 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDBVersionCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDBVersionCollection.cs @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual Response Get(string autonomousdbvers } /// - /// List AutonomousDbVersion resources by Location + /// List AutonomousDbVersion resources by SubscriptionLocationResource /// /// /// Request Path @@ -158,7 +158,7 @@ public virtual Response Get(string autonomousdbvers /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -176,7 +176,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati } /// - /// List AutonomousDbVersion resources by Location + /// List AutonomousDbVersion resources by SubscriptionLocationResource /// /// /// Request Path @@ -188,7 +188,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -261,7 +261,7 @@ public virtual async Task> ExistsAsync(string autonomousdbversion /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -304,7 +304,7 @@ public virtual Response Exists(string autonomousdbversionsname, Cancellati /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -349,7 +349,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDBVersionResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDBVersionResource.cs index 5e9b6ff9a91b..ea1c78d29285 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDBVersionResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDBVersionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupCollection.cs index 7949d6bf217b..0b6fdc3e13a0 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -248,11 +248,11 @@ public virtual Response Get(string adbbackupid /// /// /// Operation Id - /// AutonomousDatabaseBackups_ListByAutonomousDatabase + /// AutonomousDatabaseBackups_ListByParent /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -264,8 +264,8 @@ public virtual Response Get(string adbbackupid /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _autonomousDatabaseBackupRestClient.CreateListByAutonomousDatabaseRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autonomousDatabaseBackupRestClient.CreateListByAutonomousDatabaseNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _autonomousDatabaseBackupRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autonomousDatabaseBackupRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutonomousDatabaseBackupResource(Client, AutonomousDatabaseBackupData.DeserializeAutonomousDatabaseBackupData(e)), _autonomousDatabaseBackupClientDiagnostics, Pipeline, "AutonomousDatabaseBackupCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -278,11 +278,11 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Operation Id - /// AutonomousDatabaseBackups_ListByAutonomousDatabase + /// AutonomousDatabaseBackups_ListByParent /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -294,8 +294,8 @@ public virtual AsyncPageable GetAllAsync(Cance /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _autonomousDatabaseBackupRestClient.CreateListByAutonomousDatabaseRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autonomousDatabaseBackupRestClient.CreateListByAutonomousDatabaseNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _autonomousDatabaseBackupRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autonomousDatabaseBackupRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutonomousDatabaseBackupResource(Client, AutonomousDatabaseBackupData.DeserializeAutonomousDatabaseBackupData(e)), _autonomousDatabaseBackupClientDiagnostics, Pipeline, "AutonomousDatabaseBackupCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string adbbackupid, Cancel /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string adbbackupid, CancellationToken cance /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupResource.cs index e77c1e4b351d..f731ba2f8811 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetCollection.cs index ed660289b8c4..754248c9fc3c 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetCollection.cs @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual Response Get(string adbsc } /// - /// List AutonomousDatabaseCharacterSet resources by Location + /// List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource /// /// /// Request Path @@ -158,7 +158,7 @@ public virtual Response Get(string adbsc /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -176,7 +176,7 @@ public virtual AsyncPageable GetAllAsync } /// - /// List AutonomousDatabaseCharacterSet resources by Location + /// List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource /// /// /// Request Path @@ -188,7 +188,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -261,7 +261,7 @@ public virtual async Task> ExistsAsync(string adbscharsetname, Ca /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -304,7 +304,7 @@ public virtual Response Exists(string adbscharsetname, CancellationToken c /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -349,7 +349,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetResource.cs index add8b6954302..c5df9095eccc 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCollection.cs index b0ad77230b4a..1569287a9cd9 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string autonomousdatabas /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string autonomousdatabasen /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string autonomousdatabasename, Cancellation /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseData.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseData.cs index ebf77ba0b2e7..c2af47340c97 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseData.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseData.cs @@ -67,7 +67,7 @@ public AutonomousDatabaseData(AzureLocation location) : base(location) /// /// The resource-specific properties for this resource. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , , and . /// /// Keeps track of any properties unknown to the library. internal AutonomousDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, AutonomousDatabaseBaseProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) @@ -84,7 +84,7 @@ internal AutonomousDatabaseData() /// /// The resource-specific properties for this resource. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , , and . /// public AutonomousDatabaseBaseProperties Properties { get; set; } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetCollection.cs index 971fa09286e7..e8cd7d25fedb 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetCollection.cs @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual Response Get(stri } /// - /// List AutonomousDatabaseNationalCharacterSet resources by Location + /// List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource /// /// /// Request Path @@ -158,7 +158,7 @@ public virtual Response Get(stri /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -176,7 +176,7 @@ public virtual AsyncPageable Get } /// - /// List AutonomousDatabaseNationalCharacterSet resources by Location + /// List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource /// /// /// Request Path @@ -188,7 +188,7 @@ public virtual AsyncPageable Get /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual Pageable GetAll(C /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -261,7 +261,7 @@ public virtual async Task> ExistsAsync(string adbsncharsetname, C /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -304,7 +304,7 @@ public virtual Response Exists(string adbsncharsetname, CancellationToken /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -349,7 +349,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetResource.cs index b8edaac9c36f..719e9a6b37cc 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseResource.cs index d51866781728..d3139f7e514b 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseResource.cs @@ -110,7 +110,7 @@ public virtual AutonomousDatabaseBackupCollection GetAutonomousDatabaseBackups() /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAutonom /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -172,7 +172,7 @@ public virtual Response GetAutonomousDatabaseB /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -336,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -382,7 +382,7 @@ public virtual async Task> UpdateAsync( /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -415,6 +415,98 @@ public virtual ArmOperation Update(WaitUntil waitUnt } } + /// + /// Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/changeDisasterRecoveryConfiguration + /// + /// + /// Operation Id + /// AutonomousDatabases_ChangeDisasterRecoveryConfiguration + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> ChangeDisasterRecoveryConfigurationAsync(WaitUntil waitUntil, DisasterRecoveryConfigurationDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.ChangeDisasterRecoveryConfiguration"); + scope.Start(); + try + { + var response = await _autonomousDatabaseRestClient.ChangeDisasterRecoveryConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.CreateChangeDisasterRecoveryConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/changeDisasterRecoveryConfiguration + /// + /// + /// Operation Id + /// AutonomousDatabases_ChangeDisasterRecoveryConfiguration + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation ChangeDisasterRecoveryConfiguration(WaitUntil waitUntil, DisasterRecoveryConfigurationDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.ChangeDisasterRecoveryConfiguration"); + scope.Start(); + try + { + var response = _autonomousDatabaseRestClient.ChangeDisasterRecoveryConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.CreateChangeDisasterRecoveryConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Perform failover action on Autonomous Database /// @@ -428,7 +520,7 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -474,7 +566,7 @@ public virtual async Task> FailoverAsyn /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -520,7 +612,7 @@ public virtual ArmOperation Failover(WaitUntil waitU /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -562,7 +654,7 @@ public virtual async Task> GenerateWallet /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -604,7 +696,7 @@ public virtual Response GenerateWallet(GenerateAut /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -650,7 +742,7 @@ public virtual async Task> RestoreAsync /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -696,7 +788,7 @@ public virtual ArmOperation Restore(WaitUntil waitUn /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -738,7 +830,7 @@ public virtual async Task> ShrinkAsync( /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -780,7 +872,7 @@ public virtual ArmOperation Shrink(WaitUntil waitUnt /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -826,7 +918,7 @@ public virtual async Task> SwitchoverAs /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -872,7 +964,7 @@ public virtual ArmOperation Switchover(WaitUntil wai /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -934,7 +1026,7 @@ public virtual async Task> AddTagAsync(stri /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -996,7 +1088,7 @@ public virtual Response AddTag(string key, string va /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1053,7 +1145,7 @@ public virtual async Task> SetTagsAsync(IDi /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1110,7 +1202,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1170,7 +1262,7 @@ public virtual async Task> RemoveTagAsync(s /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureCollection.cs index 7d6c86d2c077..e33300e6b16e 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Crea /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string cloudexad /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Can /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationT /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string cloudexadatainfrast /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string cloudexadatainfrastructurename, Canc /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureResource.cs index 0ce169064a1c..fb7ffdf8253c 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureResource.cs @@ -110,7 +110,7 @@ public virtual OracleDBServerCollection GetOracleDBServers() /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetOracleDBServerAsy /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -172,7 +172,7 @@ public virtual Response GetOracleDBServer(string dbserve /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -336,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -382,7 +382,7 @@ public virtual async Task> Upda /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -428,7 +428,7 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -470,7 +470,7 @@ public virtual async Task> AddS /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -512,7 +512,7 @@ public virtual ArmOperation AddStorageCapaci /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -574,7 +574,7 @@ public virtual async Task> AddTagAs /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -636,7 +636,7 @@ public virtual Response AddTag(string key, s /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -693,7 +693,7 @@ public virtual async Task> SetTagsA /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -750,7 +750,7 @@ public virtual Response SetTags(IDictionary< /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -810,7 +810,7 @@ public virtual async Task> RemoveTa /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterCollection.cs index 8a45baad9fe4..2a1227854a69 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAs /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string clou /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string cloudvmclustername, C /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTok /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancell /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string cloudvmclustername, /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string cloudvmclustername, CancellationToke /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsA /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterDBNodeCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterDBNodeCollection.cs index 59721ec74eff..2c4121d4efa7 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterDBNodeCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterDBNodeCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -150,11 +150,11 @@ public virtual Response Get(string dbnodeocid, Can /// /// /// Operation Id - /// DbNodes_ListByCloudVmCluster + /// DbNodes_ListByParent /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -166,8 +166,8 @@ public virtual Response Get(string dbnodeocid, Can /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudVmClusterDBNodeDBNodesRestClient.CreateListByCloudVmClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudVmClusterDBNodeDBNodesRestClient.CreateListByCloudVmClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudVmClusterDBNodeDBNodesRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudVmClusterDBNodeDBNodesRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CloudVmClusterDBNodeResource(Client, CloudVmClusterDBNodeData.DeserializeCloudVmClusterDBNodeData(e)), _cloudVmClusterDBNodeDBNodesClientDiagnostics, Pipeline, "CloudVmClusterDBNodeCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -180,11 +180,11 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Operation Id - /// DbNodes_ListByCloudVmCluster + /// DbNodes_ListByParent /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -196,8 +196,8 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudVmClusterDBNodeDBNodesRestClient.CreateListByCloudVmClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudVmClusterDBNodeDBNodesRestClient.CreateListByCloudVmClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudVmClusterDBNodeDBNodesRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudVmClusterDBNodeDBNodesRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CloudVmClusterDBNodeResource(Client, CloudVmClusterDBNodeData.DeserializeCloudVmClusterDBNodeData(e)), _cloudVmClusterDBNodeDBNodesClientDiagnostics, Pipeline, "CloudVmClusterDBNodeCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string dbnodeocid, Cancell /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string dbnodeocid, CancellationToken cancel /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterDBNodeResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterDBNodeResource.cs index 8e002b047058..20c0e6644358 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterDBNodeResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterDBNodeResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken canc /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -228,7 +228,7 @@ public virtual async Task> ActionAsyn /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterResource.cs index 301353267a10..11bf1367f948 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterResource.cs @@ -111,7 +111,7 @@ public virtual CloudVmClusterDBNodeCollection GetCloudVmClusterDBNodes() /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetCloudVmClus /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -180,7 +180,7 @@ public virtual CloudVmClusterVirtualNetworkAddressCollection GetCloudVmClusterVi /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -242,7 +242,7 @@ public virtual Response GetCloudVmC /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual async Task> GetAsync(Cancellatio /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -322,7 +322,7 @@ public virtual Response Get(CancellationToken cancellati /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -406,7 +406,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -452,7 +452,7 @@ public virtual async Task> UpdateAsync(Wait /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -498,7 +498,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -544,7 +544,7 @@ public virtual async Task> AddVmsAsync(Wait /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -590,7 +590,7 @@ public virtual ArmOperation AddVms(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -623,7 +623,7 @@ public virtual AsyncPageable GetPrivateIPAddressesAsync( /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -656,7 +656,7 @@ public virtual Pageable GetPrivateIPAddresses(PrivateIPA /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -702,7 +702,7 @@ public virtual async Task> RemoveVmsAsync(W /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -748,7 +748,7 @@ public virtual ArmOperation RemoveVms(WaitUntil waitUnti /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -810,7 +810,7 @@ public virtual async Task> AddTagAsync(string k /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -872,7 +872,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -929,7 +929,7 @@ public virtual async Task> SetTagsAsync(IDictio /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -986,7 +986,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1046,7 +1046,7 @@ public virtual async Task> RemoveTagAsync(strin /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterVirtualNetworkAddressCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterVirtualNetworkAddressCollection.cs index 7e1323b0b949..01b0328861ac 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterVirtualNetworkAddressCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterVirtualNetworkAddressCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateO /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -248,11 +248,11 @@ public virtual Response Get(string /// /// /// Operation Id - /// VirtualNetworkAddresses_ListByCloudVmCluster + /// VirtualNetworkAddresses_ListByParent /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -264,8 +264,8 @@ public virtual Response Get(string /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudVmClusterVirtualNetworkAddressVirtualNetworkAddressesRestClient.CreateListByCloudVmClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudVmClusterVirtualNetworkAddressVirtualNetworkAddressesRestClient.CreateListByCloudVmClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudVmClusterVirtualNetworkAddressVirtualNetworkAddressesRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudVmClusterVirtualNetworkAddressVirtualNetworkAddressesRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CloudVmClusterVirtualNetworkAddressResource(Client, CloudVmClusterVirtualNetworkAddressData.DeserializeCloudVmClusterVirtualNetworkAddressData(e)), _cloudVmClusterVirtualNetworkAddressVirtualNetworkAddressesClientDiagnostics, Pipeline, "CloudVmClusterVirtualNetworkAddressCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -278,11 +278,11 @@ public virtual AsyncPageable GetAll /// /// /// Operation Id - /// VirtualNetworkAddresses_ListByCloudVmCluster + /// VirtualNetworkAddresses_ListByParent /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -294,8 +294,8 @@ public virtual AsyncPageable GetAll /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudVmClusterVirtualNetworkAddressVirtualNetworkAddressesRestClient.CreateListByCloudVmClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudVmClusterVirtualNetworkAddressVirtualNetworkAddressesRestClient.CreateListByCloudVmClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudVmClusterVirtualNetworkAddressVirtualNetworkAddressesRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudVmClusterVirtualNetworkAddressVirtualNetworkAddressesRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CloudVmClusterVirtualNetworkAddressResource(Client, CloudVmClusterVirtualNetworkAddressData.DeserializeCloudVmClusterVirtualNetworkAddressData(e)), _cloudVmClusterVirtualNetworkAddressVirtualNetworkAddressesClientDiagnostics, Pipeline, "CloudVmClusterVirtualNetworkAddressCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Canc /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string virtualnetworkaddre /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string virtualnetworkaddressname, Cancellat /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterVirtualNetworkAddressResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterVirtualNetworkAddressResource.cs index 467045fe9607..03e79ad1efa6 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterVirtualNetworkAddressResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterVirtualNetworkAddressResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancell /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterCollection.cs new file mode 100644 index 000000000000..9476ab8fcbf7 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterCollection.cs @@ -0,0 +1,494 @@ +// 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.OracleDatabase +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetExadbVmClusters method from an instance of . + /// + public partial class ExadbVmClusterCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _exadbVmClusterClientDiagnostics; + private readonly ExadbVmClustersRestOperations _exadbVmClusterRestClient; + + /// Initializes a new instance of the class for mocking. + protected ExadbVmClusterCollection() + { + } + + /// 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 ExadbVmClusterCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _exadbVmClusterClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ExadbVmClusterResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ExadbVmClusterResource.ResourceType, out string exadbVmClusterApiVersion); + _exadbVmClusterRestClient = new ExadbVmClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, exadbVmClusterApiVersion); +#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)); + } + + /// + /// Create a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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 name of the ExadbVmCluster. + /// Resource create parameters. + /// 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 exadbVmClusterName, ExadbVmClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, data, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new ExadbVmClusterOperationSource(Client), _exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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 name of the ExadbVmCluster. + /// Resource create parameters. + /// 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 exadbVmClusterName, ExadbVmClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, data, cancellationToken); + var operation = new OracleDatabaseArmOperation(new ExadbVmClusterOperationSource(Client), _exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.Get"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExadbVmClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.Get"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExadbVmClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List ExadbVmCluster resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters + /// + /// + /// Operation Id + /// ExadbVmClusters_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-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) => _exadbVmClusterRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exadbVmClusterRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExadbVmClusterResource(Client, ExadbVmClusterData.DeserializeExadbVmClusterData(e)), _exadbVmClusterClientDiagnostics, Pipeline, "ExadbVmClusterCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List ExadbVmCluster resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters + /// + /// + /// Operation Id + /// ExadbVmClusters_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-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) => _exadbVmClusterRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exadbVmClusterRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExadbVmClusterResource(Client, ExadbVmClusterData.DeserializeExadbVmClusterData(e)), _exadbVmClusterClientDiagnostics, Pipeline, "ExadbVmClusterCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.Exists"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.Exists"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ExadbVmClusterResource(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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.GetIfExists"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ExadbVmClusterResource(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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.Serialization.cs new file mode 100644 index 000000000000..e1ec90308459 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.Serialization.cs @@ -0,0 +1,204 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class ExadbVmClusterData : 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(ExadbVmClusterData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsCollectionDefined(Zones)) + { + writer.WritePropertyName("zones"u8); + writer.WriteStartArray(); + foreach (var item in Zones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + ExadbVmClusterData 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(ExadbVmClusterData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExadbVmClusterData(document.RootElement, options); + } + + internal static ExadbVmClusterData DeserializeExadbVmClusterData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExadbVmClusterProperties properties = default; + IList zones = 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 = ExadbVmClusterProperties.DeserializeExadbVmClusterProperties(property.Value, options); + continue; + } + if (property.NameEquals("zones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; + 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 ExadbVmClusterData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + zones ?? 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); + default: + throw new FormatException($"The model {nameof(ExadbVmClusterData)} does not support writing '{options.Format}' format."); + } + } + + ExadbVmClusterData 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 DeserializeExadbVmClusterData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExadbVmClusterData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.cs new file mode 100644 index 000000000000..7d9b7d350b23 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.cs @@ -0,0 +1,88 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the ExadbVmCluster data model. + /// ExadbVmCluster resource definition + /// + public partial class ExadbVmClusterData : 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 ExadbVmClusterData(AzureLocation location) : base(location) + { + Zones = new ChangeTrackingList(); + } + + /// 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 availability zones. + /// Keeps track of any properties unknown to the library. + internal ExadbVmClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExadbVmClusterProperties properties, IList zones, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Zones = zones; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExadbVmClusterData() + { + } + + /// The resource-specific properties for this resource. + public ExadbVmClusterProperties Properties { get; set; } + /// The availability zones. + public IList Zones { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.Serialization.cs new file mode 100644 index 000000000000..8de68a9361bc --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.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.OracleDatabase +{ + public partial class ExadbVmClusterResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ExadbVmClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ExadbVmClusterData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.cs new file mode 100644 index 000000000000..ac7e20b166f5 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.cs @@ -0,0 +1,868 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing an ExadbVmCluster along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetExadbVmClusterResource method. + /// Otherwise you can get one from its parent resource using the GetExadbVmCluster method. + /// + public partial class ExadbVmClusterResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The exadbVmClusterName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _exadbVmClusterClientDiagnostics; + private readonly ExadbVmClustersRestOperations _exadbVmClusterRestClient; + private readonly ExadbVmClusterData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/exadbVmClusters"; + + /// Initializes a new instance of the class for mocking. + protected ExadbVmClusterResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ExadbVmClusterResource(ArmClient client, ExadbVmClusterData 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 ExadbVmClusterResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _exadbVmClusterClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string exadbVmClusterApiVersion); + _exadbVmClusterRestClient = new ExadbVmClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, exadbVmClusterApiVersion); +#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 ExadbVmClusterData 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 ExascaleDBNodeResources in the ExadbVmCluster. + /// An object representing collection of ExascaleDBNodeResources and their operations over a ExascaleDBNodeResource. + public virtual ExascaleDBNodeCollection GetExascaleDBNodes() + { + return GetCachedClient(client => new ExascaleDBNodeCollection(client, Id)); + } + + /// + /// Get a ExascaleDbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNodes_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetExascaleDBNodeAsync(string exascaleDBNodeName, CancellationToken cancellationToken = default) + { + return await GetExascaleDBNodes().GetAsync(exascaleDBNodeName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ExascaleDbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNodes_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetExascaleDBNode(string exascaleDBNodeName, CancellationToken cancellationToken = default) + { + return GetExascaleDBNodes().Get(exascaleDBNodeName, cancellationToken); + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.Get"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExadbVmClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.Get"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExadbVmClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.Delete"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.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; + } + } + + /// + /// Delete a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.Delete"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new OracleDatabaseArmOperation(_exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.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; + } + } + + /// + /// Update a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ExadbVmClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.Update"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new ExadbVmClusterOperationSource(Client), _exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.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; + } + } + + /// + /// Update a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ExadbVmClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.Update"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new OracleDatabaseArmOperation(new ExadbVmClusterOperationSource(Client), _exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.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; + } + } + + /// + /// Remove VMs from the VM Cluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/removeVms + /// + /// + /// Operation Id + /// ExadbVmClusters_RemoveVms + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveVmsAsync(WaitUntil waitUntil, RemoveVirtualMachineFromExadbVmClusterDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.RemoveVms"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.RemoveVmsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new ExadbVmClusterOperationSource(Client), _exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.CreateRemoveVmsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Remove VMs from the VM Cluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/removeVms + /// + /// + /// Operation Id + /// ExadbVmClusters_RemoveVms + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation RemoveVms(WaitUntil waitUntil, RemoveVirtualMachineFromExadbVmClusterDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.RemoveVms"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.RemoveVms(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken); + var operation = new OracleDatabaseArmOperation(new ExadbVmClusterOperationSource(Client), _exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.CreateRemoveVmsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details).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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.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 _exadbVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ExadbVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ExadbVmClusterPatch(); + 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.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 = _exadbVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ExadbVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ExadbVmClusterPatch(); + 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.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 _exadbVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ExadbVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ExadbVmClusterPatch(); + 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.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 = _exadbVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ExadbVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ExadbVmClusterPatch(); + 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.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 _exadbVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ExadbVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ExadbVmClusterPatch(); + 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.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 = _exadbVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ExadbVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ExadbVmClusterPatch(); + 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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeCollection.cs new file mode 100644 index 000000000000..4ced75872925 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeCollection.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.OracleDatabase +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetExascaleDBNodes method from an instance of . + /// + public partial class ExascaleDBNodeCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _exascaleDBNodeExascaleDBNodesClientDiagnostics; + private readonly ExascaleDbNodesRestOperations _exascaleDBNodeExascaleDBNodesRestClient; + + /// Initializes a new instance of the class for mocking. + protected ExascaleDBNodeCollection() + { + } + + /// 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 ExascaleDBNodeCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _exascaleDBNodeExascaleDBNodesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ExascaleDBNodeResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ExascaleDBNodeResource.ResourceType, out string exascaleDBNodeExascaleDBNodesApiVersion); + _exascaleDBNodeExascaleDBNodesRestClient = new ExascaleDbNodesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, exascaleDBNodeExascaleDBNodesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ExadbVmClusterResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ExadbVmClusterResource.ResourceType), nameof(id)); + } + + /// + /// Get a ExascaleDbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNodes_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string exascaleDBNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDBNodeName, nameof(exascaleDBNodeName)); + + using var scope = _exascaleDBNodeExascaleDBNodesClientDiagnostics.CreateScope("ExascaleDBNodeCollection.Get"); + scope.Start(); + try + { + var response = await _exascaleDBNodeExascaleDBNodesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exascaleDBNodeName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExascaleDBNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExascaleDbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNodes_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string exascaleDBNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDBNodeName, nameof(exascaleDBNodeName)); + + using var scope = _exascaleDBNodeExascaleDBNodesClientDiagnostics.CreateScope("ExascaleDBNodeCollection.Get"); + scope.Start(); + try + { + var response = _exascaleDBNodeExascaleDBNodesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exascaleDBNodeName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExascaleDBNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List ExascaleDbNode resources by ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes + /// + /// + /// Operation Id + /// ExascaleDbNodes_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-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) => _exascaleDBNodeExascaleDBNodesRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exascaleDBNodeExascaleDBNodesRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExascaleDBNodeResource(Client, ExascaleDBNodeData.DeserializeExascaleDBNodeData(e)), _exascaleDBNodeExascaleDBNodesClientDiagnostics, Pipeline, "ExascaleDBNodeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List ExascaleDbNode resources by ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes + /// + /// + /// Operation Id + /// ExascaleDbNodes_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-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) => _exascaleDBNodeExascaleDBNodesRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exascaleDBNodeExascaleDBNodesRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExascaleDBNodeResource(Client, ExascaleDBNodeData.DeserializeExascaleDBNodeData(e)), _exascaleDBNodeExascaleDBNodesClientDiagnostics, Pipeline, "ExascaleDBNodeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNodes_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string exascaleDBNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDBNodeName, nameof(exascaleDBNodeName)); + + using var scope = _exascaleDBNodeExascaleDBNodesClientDiagnostics.CreateScope("ExascaleDBNodeCollection.Exists"); + scope.Start(); + try + { + var response = await _exascaleDBNodeExascaleDBNodesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exascaleDBNodeName, 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNodes_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string exascaleDBNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDBNodeName, nameof(exascaleDBNodeName)); + + using var scope = _exascaleDBNodeExascaleDBNodesClientDiagnostics.CreateScope("ExascaleDBNodeCollection.Exists"); + scope.Start(); + try + { + var response = _exascaleDBNodeExascaleDBNodesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exascaleDBNodeName, 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNodes_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string exascaleDBNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDBNodeName, nameof(exascaleDBNodeName)); + + using var scope = _exascaleDBNodeExascaleDBNodesClientDiagnostics.CreateScope("ExascaleDBNodeCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _exascaleDBNodeExascaleDBNodesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exascaleDBNodeName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ExascaleDBNodeResource(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/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNodes_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string exascaleDBNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDBNodeName, nameof(exascaleDBNodeName)); + + using var scope = _exascaleDBNodeExascaleDBNodesClientDiagnostics.CreateScope("ExascaleDBNodeCollection.GetIfExists"); + scope.Start(); + try + { + var response = _exascaleDBNodeExascaleDBNodesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exascaleDBNodeName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ExascaleDBNodeResource(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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeData.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeData.Serialization.cs new file mode 100644 index 000000000000..439b288a1dc3 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class ExascaleDBNodeData : 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(ExascaleDBNodeData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + ExascaleDBNodeData 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(ExascaleDBNodeData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDBNodeData(document.RootElement, options); + } + + internal static ExascaleDBNodeData DeserializeExascaleDBNodeData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExascaleDBNodeProperties 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 = ExascaleDBNodeProperties.DeserializeExascaleDBNodeProperties(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 ExascaleDBNodeData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExascaleDBNodeData)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDBNodeData 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 DeserializeExascaleDBNodeData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDBNodeData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeData.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeData.cs new file mode 100644 index 000000000000..674985518d26 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the ExascaleDBNode data model. + /// The DbNode resource belonging to ExadbVmCluster + /// + public partial class ExascaleDBNodeData : 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 ExascaleDBNodeData() + { + } + + /// 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 ExascaleDBNodeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ExascaleDBNodeProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public ExascaleDBNodeProperties Properties { get; set; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeResource.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeResource.Serialization.cs new file mode 100644 index 000000000000..ac1a1b1f370f --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeResource.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.OracleDatabase +{ + public partial class ExascaleDBNodeResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ExascaleDBNodeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ExascaleDBNodeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeResource.cs new file mode 100644 index 000000000000..28ce67286da6 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBNodeResource.cs @@ -0,0 +1,264 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing an ExascaleDBNode along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetExascaleDBNodeResource method. + /// Otherwise you can get one from its parent resource using the GetExascaleDBNode method. + /// + public partial class ExascaleDBNodeResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The exadbVmClusterName. + /// The exascaleDBNodeName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string exadbVmClusterName, string exascaleDBNodeName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDBNodeName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _exascaleDBNodeExascaleDBNodesClientDiagnostics; + private readonly ExascaleDbNodesRestOperations _exascaleDBNodeExascaleDBNodesRestClient; + private readonly ExascaleDBNodeData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/exadbVmClusters/dbNodes"; + + /// Initializes a new instance of the class for mocking. + protected ExascaleDBNodeResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ExascaleDBNodeResource(ArmClient client, ExascaleDBNodeData 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 ExascaleDBNodeResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _exascaleDBNodeExascaleDBNodesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string exascaleDBNodeExascaleDBNodesApiVersion); + _exascaleDBNodeExascaleDBNodesRestClient = new ExascaleDbNodesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, exascaleDBNodeExascaleDBNodesApiVersion); +#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 ExascaleDBNodeData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a ExascaleDbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNodes_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _exascaleDBNodeExascaleDBNodesClientDiagnostics.CreateScope("ExascaleDBNodeResource.Get"); + scope.Start(); + try + { + var response = await _exascaleDBNodeExascaleDBNodesRestClient.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 ExascaleDBNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExascaleDbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNodes_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _exascaleDBNodeExascaleDBNodesClientDiagnostics.CreateScope("ExascaleDBNodeResource.Get"); + scope.Start(); + try + { + var response = _exascaleDBNodeExascaleDBNodesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExascaleDBNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// VM actions on DbNode of ExadbVmCluster by the provided filter + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName}/action + /// + /// + /// Operation Id + /// ExascaleDbNodes_Action + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> ActionAsync(WaitUntil waitUntil, DBNodeAction body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _exascaleDBNodeExascaleDBNodesClientDiagnostics.CreateScope("ExascaleDBNodeResource.Action"); + scope.Start(); + try + { + var response = await _exascaleDBNodeExascaleDBNodesRestClient.ActionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new DBActionResponseOperationSource(), _exascaleDBNodeExascaleDBNodesClientDiagnostics, Pipeline, _exascaleDBNodeExascaleDBNodesRestClient.CreateActionRequest(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; + } + } + + /// + /// VM actions on DbNode of ExadbVmCluster by the provided filter + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName}/action + /// + /// + /// Operation Id + /// ExascaleDbNodes_Action + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Action(WaitUntil waitUntil, DBNodeAction body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _exascaleDBNodeExascaleDBNodesClientDiagnostics.CreateScope("ExascaleDBNodeResource.Action"); + scope.Start(); + try + { + var response = _exascaleDBNodeExascaleDBNodesRestClient.Action(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new OracleDatabaseArmOperation(new DBActionResponseOperationSource(), _exascaleDBNodeExascaleDBNodesClientDiagnostics, Pipeline, _exascaleDBNodeExascaleDBNodesRestClient.CreateActionRequest(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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultCollection.cs new file mode 100644 index 000000000000..84e5f297ee3c --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultCollection.cs @@ -0,0 +1,494 @@ +// 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.OracleDatabase +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetExascaleDBStorageVaults method from an instance of . + /// + public partial class ExascaleDBStorageVaultCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics; + private readonly ExascaleDbStorageVaultsRestOperations _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient; + + /// Initializes a new instance of the class for mocking. + protected ExascaleDBStorageVaultCollection() + { + } + + /// 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 ExascaleDBStorageVaultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ExascaleDBStorageVaultResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ExascaleDBStorageVaultResource.ResourceType, out string exascaleDBStorageVaultExascaleDBStorageVaultsApiVersion); + _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient = new ExascaleDbStorageVaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, exascaleDBStorageVaultExascaleDBStorageVaultsApiVersion); +#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)); + } + + /// + /// Create a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Create + /// + /// + /// Default Api Version + /// 2025-03-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 name of the ExascaleDbStorageVault. + /// Resource create parameters. + /// 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 exascaleDBStorageVaultName, ExascaleDBStorageVaultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, exascaleDBStorageVaultName, data, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new ExascaleDBStorageVaultOperationSource(Client), _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics, Pipeline, _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, exascaleDBStorageVaultName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Create + /// + /// + /// Default Api Version + /// 2025-03-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 name of the ExascaleDbStorageVault. + /// Resource create parameters. + /// 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 exascaleDBStorageVaultName, ExascaleDBStorageVaultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, exascaleDBStorageVaultName, data, cancellationToken); + var operation = new OracleDatabaseArmOperation(new ExascaleDBStorageVaultOperationSource(Client), _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics, Pipeline, _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, exascaleDBStorageVaultName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string exascaleDBStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + + using var scope = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultCollection.Get"); + scope.Start(); + try + { + var response = await _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, exascaleDBStorageVaultName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExascaleDBStorageVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string exascaleDBStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + + using var scope = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultCollection.Get"); + scope.Start(); + try + { + var response = _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, exascaleDBStorageVaultName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExascaleDBStorageVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List ExascaleDbStorageVault resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-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) => _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExascaleDBStorageVaultResource(Client, ExascaleDBStorageVaultData.DeserializeExascaleDBStorageVaultData(e)), _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics, Pipeline, "ExascaleDBStorageVaultCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List ExascaleDbStorageVault resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-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) => _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExascaleDBStorageVaultResource(Client, ExascaleDBStorageVaultData.DeserializeExascaleDBStorageVaultData(e)), _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics, Pipeline, "ExascaleDBStorageVaultCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string exascaleDBStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + + using var scope = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultCollection.Exists"); + scope.Start(); + try + { + var response = await _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, exascaleDBStorageVaultName, 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string exascaleDBStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + + using var scope = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultCollection.Exists"); + scope.Start(); + try + { + var response = _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, exascaleDBStorageVaultName, 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string exascaleDBStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + + using var scope = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, exascaleDBStorageVaultName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ExascaleDBStorageVaultResource(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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string exascaleDBStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + + using var scope = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultCollection.GetIfExists"); + scope.Start(); + try + { + var response = _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, exascaleDBStorageVaultName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ExascaleDBStorageVaultResource(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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultData.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultData.Serialization.cs new file mode 100644 index 000000000000..f3a75ad746e5 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultData.Serialization.cs @@ -0,0 +1,204 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class ExascaleDBStorageVaultData : 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(ExascaleDBStorageVaultData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsCollectionDefined(Zones)) + { + writer.WritePropertyName("zones"u8); + writer.WriteStartArray(); + foreach (var item in Zones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + ExascaleDBStorageVaultData 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(ExascaleDBStorageVaultData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDBStorageVaultData(document.RootElement, options); + } + + internal static ExascaleDBStorageVaultData DeserializeExascaleDBStorageVaultData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExascaleDBStorageVaultProperties properties = default; + IList zones = 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 = ExascaleDBStorageVaultProperties.DeserializeExascaleDBStorageVaultProperties(property.Value, options); + continue; + } + if (property.NameEquals("zones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; + 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 ExascaleDBStorageVaultData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + zones ?? 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); + default: + throw new FormatException($"The model {nameof(ExascaleDBStorageVaultData)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDBStorageVaultData 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 DeserializeExascaleDBStorageVaultData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDBStorageVaultData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultData.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultData.cs new file mode 100644 index 000000000000..549721747266 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultData.cs @@ -0,0 +1,88 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the ExascaleDBStorageVault data model. + /// ExascaleDbStorageVault resource definition + /// + public partial class ExascaleDBStorageVaultData : 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 ExascaleDBStorageVaultData(AzureLocation location) : base(location) + { + Zones = new ChangeTrackingList(); + } + + /// 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 availability zones. + /// Keeps track of any properties unknown to the library. + internal ExascaleDBStorageVaultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExascaleDBStorageVaultProperties properties, IList zones, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Zones = zones; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExascaleDBStorageVaultData() + { + } + + /// The resource-specific properties for this resource. + public ExascaleDBStorageVaultProperties Properties { get; set; } + /// The availability zones. + public IList Zones { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultResource.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultResource.Serialization.cs new file mode 100644 index 000000000000..a9752ad22aa6 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultResource.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.OracleDatabase +{ + public partial class ExascaleDBStorageVaultResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ExascaleDBStorageVaultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ExascaleDBStorageVaultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultResource.cs new file mode 100644 index 000000000000..ea1bd4d6b210 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDBStorageVaultResource.cs @@ -0,0 +1,707 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing an ExascaleDBStorageVault along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetExascaleDBStorageVaultResource method. + /// Otherwise you can get one from its parent resource using the GetExascaleDBStorageVault method. + /// + public partial class ExascaleDBStorageVaultResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The exascaleDBStorageVaultName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string exascaleDBStorageVaultName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDBStorageVaultName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics; + private readonly ExascaleDbStorageVaultsRestOperations _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient; + private readonly ExascaleDBStorageVaultData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/exascaleDbStorageVaults"; + + /// Initializes a new instance of the class for mocking. + protected ExascaleDBStorageVaultResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ExascaleDBStorageVaultResource(ArmClient client, ExascaleDBStorageVaultData 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 ExascaleDBStorageVaultResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string exascaleDBStorageVaultExascaleDBStorageVaultsApiVersion); + _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient = new ExascaleDbStorageVaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, exascaleDBStorageVaultExascaleDBStorageVaultsApiVersion); +#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 ExascaleDBStorageVaultData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultResource.Get"); + scope.Start(); + try + { + var response = await _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExascaleDBStorageVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultResource.Get"); + scope.Start(); + try + { + var response = _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExascaleDBStorageVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultResource.Delete"); + scope.Start(); + try + { + var response = await _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics, Pipeline, _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.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; + } + } + + /// + /// Delete a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultResource.Delete"); + scope.Start(); + try + { + var response = _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new OracleDatabaseArmOperation(_exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics, Pipeline, _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.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; + } + } + + /// + /// Update a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ExascaleDBStorageVaultPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultResource.Update"); + scope.Start(); + try + { + var response = await _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new ExascaleDBStorageVaultOperationSource(Client), _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics, Pipeline, _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.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; + } + } + + /// + /// Update a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ExascaleDBStorageVaultPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultResource.Update"); + scope.Start(); + try + { + var response = _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new OracleDatabaseArmOperation(new ExascaleDBStorageVaultOperationSource(Client), _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics, Pipeline, _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultResource.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 _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ExascaleDBStorageVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ExascaleDBStorageVaultPatch(); + 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultResource.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 = _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ExascaleDBStorageVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ExascaleDBStorageVaultPatch(); + 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultResource.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 _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ExascaleDBStorageVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ExascaleDBStorageVaultPatch(); + 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultResource.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 = _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ExascaleDBStorageVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ExascaleDBStorageVaultPatch(); + 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultResource.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 _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ExascaleDBStorageVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ExascaleDBStorageVaultPatch(); + 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics.CreateScope("ExascaleDBStorageVaultResource.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 = _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ExascaleDBStorageVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ExascaleDBStorageVaultPatch(); + 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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseArmClient.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseArmClient.cs index 4a867265ef0a..9ad4b317e924 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseArmClient.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseArmClient.cs @@ -70,6 +70,30 @@ public virtual CloudVmClusterResource GetCloudVmClusterResource(ResourceIdentifi return new CloudVmClusterResource(Client, id); } + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExadbVmClusterResource GetExadbVmClusterResource(ResourceIdentifier id) + { + ExadbVmClusterResource.ValidateResourceId(id); + return new ExadbVmClusterResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExascaleDBStorageVaultResource GetExascaleDBStorageVaultResource(ResourceIdentifier id) + { + ExascaleDBStorageVaultResource.ValidateResourceId(id); + return new ExascaleDBStorageVaultResource(Client, id); + } + /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. @@ -142,6 +166,18 @@ public virtual OracleDnsPrivateZoneResource GetOracleDnsPrivateZoneResource(Reso return new OracleDnsPrivateZoneResource(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 FlexComponentResource GetFlexComponentResource(ResourceIdentifier id) + { + FlexComponentResource.ValidateResourceId(id); + return new FlexComponentResource(Client, id); + } + /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. @@ -154,6 +190,18 @@ public virtual OracleGIVersionResource GetOracleGIVersionResource(ResourceIdenti return new OracleGIVersionResource(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 GiMinorVersionResource GetGiMinorVersionResource(ResourceIdentifier id) + { + GiMinorVersionResource.ValidateResourceId(id); + return new GiMinorVersionResource(Client, id); + } + /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. @@ -225,5 +273,17 @@ public virtual CloudVmClusterVirtualNetworkAddressResource GetCloudVmClusterVirt CloudVmClusterVirtualNetworkAddressResource.ValidateResourceId(id); return new CloudVmClusterVirtualNetworkAddressResource(Client, id); } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExascaleDBNodeResource GetExascaleDBNodeResource(ResourceIdentifier id) + { + ExascaleDBNodeResource.ValidateResourceId(id); + return new ExascaleDBNodeResource(Client, id); + } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseResourceGroupResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseResourceGroupResource.cs index b04720fb1980..f6fd3404a200 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseResourceGroupResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual AutonomousDatabaseCollection GetAutonomousDatabases() /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetAutonomousDat /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -122,7 +122,7 @@ public virtual CloudExadataInfrastructureCollection GetCloudExadataInfrastructur /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -153,7 +153,7 @@ public virtual async Task> GetCloud /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -191,7 +191,7 @@ public virtual CloudVmClusterCollection GetCloudVmClusters() /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -222,7 +222,7 @@ public virtual async Task> GetCloudVmClusterAsy /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -239,5 +239,143 @@ public virtual Response GetCloudVmCluster(string cloudvm { return GetCloudVmClusters().Get(cloudvmclustername, cancellationToken); } + + /// Gets a collection of ExadbVmClusterResources in the ResourceGroupResource. + /// An object representing collection of ExadbVmClusterResources and their operations over a ExadbVmClusterResource. + public virtual ExadbVmClusterCollection GetExadbVmClusters() + { + return GetCachedClient(client => new ExadbVmClusterCollection(client, Id)); + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetExadbVmClusterAsync(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + return await GetExadbVmClusters().GetAsync(exadbVmClusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetExadbVmCluster(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + return GetExadbVmClusters().Get(exadbVmClusterName, cancellationToken); + } + + /// Gets a collection of ExascaleDBStorageVaultResources in the ResourceGroupResource. + /// An object representing collection of ExascaleDBStorageVaultResources and their operations over a ExascaleDBStorageVaultResource. + public virtual ExascaleDBStorageVaultCollection GetExascaleDBStorageVaults() + { + return GetCachedClient(client => new ExascaleDBStorageVaultCollection(client, Id)); + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetExascaleDBStorageVaultAsync(string exascaleDBStorageVaultName, CancellationToken cancellationToken = default) + { + return await GetExascaleDBStorageVaults().GetAsync(exascaleDBStorageVaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetExascaleDBStorageVault(string exascaleDBStorageVaultName, CancellationToken cancellationToken = default) + { + return GetExascaleDBStorageVaults().Get(exascaleDBStorageVaultName, cancellationToken); + } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseSubscriptionResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseSubscriptionResource.cs index 0b4249a63a43..f945a5100552 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseSubscriptionResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseSubscriptionResource.cs @@ -23,6 +23,10 @@ public partial class MockableOracleDatabaseSubscriptionResource : ArmResource private CloudExadataInfrastructuresRestOperations _cloudExadataInfrastructureRestClient; private ClientDiagnostics _cloudVmClusterClientDiagnostics; private CloudVmClustersRestOperations _cloudVmClusterRestClient; + private ClientDiagnostics _exadbVmClusterClientDiagnostics; + private ExadbVmClustersRestOperations _exadbVmClusterRestClient; + private ClientDiagnostics _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics; + private ExascaleDbStorageVaultsRestOperations _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient; /// Initializes a new instance of the class for mocking. protected MockableOracleDatabaseSubscriptionResource() @@ -42,6 +46,10 @@ internal MockableOracleDatabaseSubscriptionResource(ArmClient client, ResourceId private CloudExadataInfrastructuresRestOperations CloudExadataInfrastructureRestClient => _cloudExadataInfrastructureRestClient ??= new CloudExadataInfrastructuresRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CloudExadataInfrastructureResource.ResourceType)); private ClientDiagnostics CloudVmClusterClientDiagnostics => _cloudVmClusterClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", CloudVmClusterResource.ResourceType.Namespace, Diagnostics); private CloudVmClustersRestOperations CloudVmClusterRestClient => _cloudVmClusterRestClient ??= new CloudVmClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CloudVmClusterResource.ResourceType)); + private ClientDiagnostics ExadbVmClusterClientDiagnostics => _exadbVmClusterClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ExadbVmClusterResource.ResourceType.Namespace, Diagnostics); + private ExadbVmClustersRestOperations ExadbVmClusterRestClient => _exadbVmClusterRestClient ??= new ExadbVmClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ExadbVmClusterResource.ResourceType)); + private ClientDiagnostics ExascaleDBStorageVaultExascaleDbStorageVaultsClientDiagnostics => _exascaleDBStorageVaultExascaleDBStorageVaultsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ExascaleDBStorageVaultResource.ResourceType.Namespace, Diagnostics); + private ExascaleDbStorageVaultsRestOperations ExascaleDBStorageVaultExascaleDbStorageVaultsRestClient => _exascaleDBStorageVaultExascaleDBStorageVaultsRestClient ??= new ExascaleDbStorageVaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ExascaleDBStorageVaultResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -70,7 +78,7 @@ public virtual AutonomousDatabaseCharacterSetCollection GetAutonomousDatabaseCha /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -102,7 +110,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -142,7 +150,7 @@ public virtual AutonomousDatabaseNationalCharacterSetCollection GetAutonomousDat /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -174,7 +182,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -214,7 +222,7 @@ public virtual AutonomousDBVersionCollection GetAutonomousDBVersions(AzureLocati /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -246,7 +254,7 @@ public virtual async Task> GetAutonomousDB /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -286,7 +294,7 @@ public virtual OracleDBSystemShapeCollection GetOracleDBSystemShapes(AzureLocati /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -318,7 +326,7 @@ public virtual async Task> GetOracleDBSyst /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -358,7 +366,7 @@ public virtual OracleDnsPrivateViewCollection GetOracleDnsPrivateViews(AzureLoca /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -390,7 +398,7 @@ public virtual async Task> GetOracleDnsPr /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -430,7 +438,7 @@ public virtual OracleDnsPrivateZoneCollection GetOracleDnsPrivateZones(AzureLoca /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -462,7 +470,7 @@ public virtual async Task> GetOracleDnsPr /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -481,6 +489,78 @@ public virtual Response GetOracleDnsPrivateZone(Az return GetOracleDnsPrivateZones(location).Get(dnsprivatezonename, cancellationToken); } + /// Gets a collection of FlexComponentResources in the SubscriptionResource. + /// The name of the Azure region. + /// An object representing collection of FlexComponentResources and their operations over a FlexComponentResource. + public virtual FlexComponentCollection GetFlexComponents(AzureLocation location) + { + return new FlexComponentCollection(Client, Id, location); + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponents_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFlexComponentAsync(AzureLocation location, string flexComponentName, CancellationToken cancellationToken = default) + { + return await GetFlexComponents(location).GetAsync(flexComponentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponents_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFlexComponent(AzureLocation location, string flexComponentName, CancellationToken cancellationToken = default) + { + return GetFlexComponents(location).Get(flexComponentName, cancellationToken); + } + /// Gets a collection of OracleGIVersionResources in the SubscriptionResource. /// The name of the Azure region. /// An object representing collection of OracleGIVersionResources and their operations over a OracleGIVersionResource. @@ -502,7 +582,7 @@ public virtual OracleGIVersionCollection GetOracleGIVersions(AzureLocation locat /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -534,7 +614,7 @@ public virtual async Task> GetOracleGIVersionA /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -574,7 +654,7 @@ public virtual OracleSystemVersionCollection GetOracleSystemVersions(AzureLocati /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -606,7 +686,7 @@ public virtual async Task> GetOracleSystem /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -645,7 +725,7 @@ public virtual OracleSubscriptionResource GetOracleSubscription() /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -675,7 +755,7 @@ public virtual AsyncPageable GetAutonomousDatabasesA /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -705,7 +785,7 @@ public virtual Pageable GetAutonomousDatabases(Cance /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -735,7 +815,7 @@ public virtual AsyncPageable GetCloudExadata /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -765,7 +845,7 @@ public virtual Pageable GetCloudExadataInfra /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -795,7 +875,7 @@ public virtual AsyncPageable GetCloudVmClustersAsync(Can /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -811,5 +891,125 @@ public virtual Pageable GetCloudVmClusters(CancellationT HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CloudVmClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CloudVmClusterResource(Client, CloudVmClusterData.DeserializeCloudVmClusterData(e)), CloudVmClusterClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetCloudVmClusters", "value", "nextLink", cancellationToken); } + + /// + /// List ExadbVmCluster resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exadbVmClusters + /// + /// + /// Operation Id + /// ExadbVmClusters_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetExadbVmClustersAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ExadbVmClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExadbVmClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExadbVmClusterResource(Client, ExadbVmClusterData.DeserializeExadbVmClusterData(e)), ExadbVmClusterClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetExadbVmClusters", "value", "nextLink", cancellationToken); + } + + /// + /// List ExadbVmCluster resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exadbVmClusters + /// + /// + /// Operation Id + /// ExadbVmClusters_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetExadbVmClusters(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ExadbVmClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExadbVmClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExadbVmClusterResource(Client, ExadbVmClusterData.DeserializeExadbVmClusterData(e)), ExadbVmClusterClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetExadbVmClusters", "value", "nextLink", cancellationToken); + } + + /// + /// List ExascaleDbStorageVault resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exascaleDbStorageVaults + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetExascaleDBStorageVaultsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ExascaleDBStorageVaultExascaleDbStorageVaultsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExascaleDBStorageVaultExascaleDbStorageVaultsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExascaleDBStorageVaultResource(Client, ExascaleDBStorageVaultData.DeserializeExascaleDBStorageVaultData(e)), ExascaleDBStorageVaultExascaleDbStorageVaultsClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetExascaleDBStorageVaults", "value", "nextLink", cancellationToken); + } + + /// + /// List ExascaleDbStorageVault resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exascaleDbStorageVaults + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetExascaleDBStorageVaults(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ExascaleDBStorageVaultExascaleDbStorageVaultsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExascaleDBStorageVaultExascaleDbStorageVaultsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExascaleDBStorageVaultResource(Client, ExascaleDBStorageVaultData.DeserializeExascaleDBStorageVaultData(e)), ExascaleDBStorageVaultExascaleDbStorageVaultsClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetExascaleDBStorageVaults", "value", "nextLink", cancellationToken); + } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/OracleDatabaseExtensions.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/OracleDatabaseExtensions.cs index cf143a951a26..01e17de679ab 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/OracleDatabaseExtensions.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/OracleDatabaseExtensions.cs @@ -89,6 +89,44 @@ public static CloudVmClusterResource GetCloudVmClusterResource(this ArmClient cl return GetMockableOracleDatabaseArmClient(client).GetCloudVmClusterResource(id); } + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// 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 ExadbVmClusterResource GetExadbVmClusterResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetExadbVmClusterResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// 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 ExascaleDBStorageVaultResource GetExascaleDBStorageVaultResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetExascaleDBStorageVaultResource(id); + } + /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. @@ -203,6 +241,25 @@ public static OracleDnsPrivateZoneResource GetOracleDnsPrivateZoneResource(this return GetMockableOracleDatabaseArmClient(client).GetOracleDnsPrivateZoneResource(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 FlexComponentResource GetFlexComponentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetFlexComponentResource(id); + } + /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. @@ -222,6 +279,25 @@ public static OracleGIVersionResource GetOracleGIVersionResource(this ArmClient return GetMockableOracleDatabaseArmClient(client).GetOracleGIVersionResource(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 GiMinorVersionResource GetGiMinorVersionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetGiMinorVersionResource(id); + } + /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. @@ -336,6 +412,25 @@ public static CloudVmClusterVirtualNetworkAddressResource GetCloudVmClusterVirtu return GetMockableOracleDatabaseArmClient(client).GetCloudVmClusterVirtualNetworkAddressResource(id); } + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// 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 ExascaleDBNodeResource GetExascaleDBNodeResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetExascaleDBNodeResource(id); + } + /// /// Gets a collection of AutonomousDatabaseResources in the ResourceGroupResource. /// @@ -366,7 +461,7 @@ public static AutonomousDatabaseCollection GetAutonomousDatabases(this ResourceG /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -404,7 +499,7 @@ public static async Task> GetAutonomousData /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -459,7 +554,7 @@ public static CloudExadataInfrastructureCollection GetCloudExadataInfrastructure /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -497,7 +592,7 @@ public static async Task> GetCloudE /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -552,7 +647,7 @@ public static CloudVmClusterCollection GetCloudVmClusters(this ResourceGroupReso /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -590,7 +685,7 @@ public static async Task> GetCloudVmClusterAsyn /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -615,6 +710,192 @@ public static Response GetCloudVmCluster(this ResourceGr return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetCloudVmCluster(cloudvmclustername, cancellationToken); } + /// + /// Gets a collection of ExadbVmClusterResources 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 ExadbVmClusterResources and their operations over a ExadbVmClusterResource. + public static ExadbVmClusterCollection GetExadbVmClusters(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetExadbVmClusters(); + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetExadbVmClusterAsync(this ResourceGroupResource resourceGroupResource, string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetExadbVmClusterAsync(exadbVmClusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmClusters_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetExadbVmCluster(this ResourceGroupResource resourceGroupResource, string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetExadbVmCluster(exadbVmClusterName, cancellationToken); + } + + /// + /// Gets a collection of ExascaleDBStorageVaultResources 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 ExascaleDBStorageVaultResources and their operations over a ExascaleDBStorageVaultResource. + public static ExascaleDBStorageVaultCollection GetExascaleDBStorageVaults(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetExascaleDBStorageVaults(); + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetExascaleDBStorageVaultAsync(this ResourceGroupResource resourceGroupResource, string exascaleDBStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetExascaleDBStorageVaultAsync(exascaleDBStorageVaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetExascaleDBStorageVault(this ResourceGroupResource resourceGroupResource, string exascaleDBStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetExascaleDBStorageVault(exascaleDBStorageVaultName, cancellationToken); + } + /// /// Gets a collection of AutonomousDatabaseCharacterSetResources in the SubscriptionResource. /// @@ -646,7 +927,7 @@ public static AutonomousDatabaseCharacterSetCollection GetAutonomousDatabaseChar /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -685,7 +966,7 @@ public static async Task> GetAu /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -742,7 +1023,7 @@ public static AutonomousDatabaseNationalCharacterSetCollection GetAutonomousData /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -781,7 +1062,7 @@ public static async Task /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -838,7 +1119,7 @@ public static AutonomousDBVersionCollection GetAutonomousDBVersions(this Subscri /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -877,7 +1158,7 @@ public static async Task> GetAutonomousDBV /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -934,7 +1215,7 @@ public static OracleDBSystemShapeCollection GetOracleDBSystemShapes(this Subscri /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -973,7 +1254,7 @@ public static async Task> GetOracleDBSyste /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1030,7 +1311,7 @@ public static OracleDnsPrivateViewCollection GetOracleDnsPrivateViews(this Subsc /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1069,7 +1350,7 @@ public static async Task> GetOracleDnsPri /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1126,7 +1407,7 @@ public static OracleDnsPrivateZoneCollection GetOracleDnsPrivateZones(this Subsc /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1165,7 +1446,7 @@ public static async Task> GetOracleDnsPri /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1191,6 +1472,102 @@ public static Response GetOracleDnsPrivateZone(thi return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetOracleDnsPrivateZone(location, dnsprivatezonename, cancellationToken); } + /// + /// Gets a collection of FlexComponentResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// is null. + /// An object representing collection of FlexComponentResources and their operations over a FlexComponentResource. + public static FlexComponentCollection GetFlexComponents(this SubscriptionResource subscriptionResource, AzureLocation location) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetFlexComponents(location); + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponents_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The name of the FlexComponent. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetFlexComponentAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetFlexComponentAsync(location, flexComponentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponents_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The name of the FlexComponent. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetFlexComponent(this SubscriptionResource subscriptionResource, AzureLocation location, string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetFlexComponent(location, flexComponentName, cancellationToken); + } + /// /// Gets a collection of OracleGIVersionResources in the SubscriptionResource. /// @@ -1222,7 +1599,7 @@ public static OracleGIVersionCollection GetOracleGIVersions(this SubscriptionRes /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1261,7 +1638,7 @@ public static async Task> GetOracleGIVersionAs /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1318,7 +1695,7 @@ public static OracleSystemVersionCollection GetOracleSystemVersions(this Subscri /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1357,7 +1734,7 @@ public static async Task> GetOracleSystemV /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1413,7 +1790,7 @@ public static OracleSubscriptionResource GetOracleSubscription(this Subscription /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1449,7 +1826,7 @@ public static AsyncPageable GetAutonomousDatabasesAs /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1485,7 +1862,7 @@ public static Pageable GetAutonomousDatabases(this S /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1521,7 +1898,7 @@ public static AsyncPageable GetCloudExadataI /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1557,7 +1934,7 @@ public static Pageable GetCloudExadataInfras /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1593,7 +1970,7 @@ public static AsyncPageable GetCloudVmClustersAsync(this /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -1615,5 +1992,149 @@ public static Pageable GetCloudVmClusters(this Subscript return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetCloudVmClusters(cancellationToken); } + + /// + /// List ExadbVmCluster resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exadbVmClusters + /// + /// + /// Operation Id + /// ExadbVmClusters_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-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 GetExadbVmClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetExadbVmClustersAsync(cancellationToken); + } + + /// + /// List ExadbVmCluster resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exadbVmClusters + /// + /// + /// Operation Id + /// ExadbVmClusters_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-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 GetExadbVmClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetExadbVmClusters(cancellationToken); + } + + /// + /// List ExascaleDbStorageVault resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exascaleDbStorageVaults + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-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 GetExascaleDBStorageVaultsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetExascaleDBStorageVaultsAsync(cancellationToken); + } + + /// + /// List ExascaleDbStorageVault resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exascaleDbStorageVaults + /// + /// + /// Operation Id + /// ExascaleDbStorageVaults_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-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 GetExascaleDBStorageVaults(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetExascaleDBStorageVaults(cancellationToken); + } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentCollection.cs new file mode 100644 index 000000000000..ba5454b65b5c --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentCollection.cs @@ -0,0 +1,402 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// 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 GetFlexComponents method from an instance of . + /// + public partial class FlexComponentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _flexComponentClientDiagnostics; + private readonly FlexComponentsRestOperations _flexComponentRestClient; + private readonly AzureLocation _location; + + /// Initializes a new instance of the class for mocking. + protected FlexComponentCollection() + { + } + + /// 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. + /// The name of the Azure region. + internal FlexComponentCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) + { + _location = location; + _flexComponentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", FlexComponentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FlexComponentResource.ResourceType, out string flexComponentApiVersion); + _flexComponentRestClient = new FlexComponentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, flexComponentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponents_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentCollection.Get"); + scope.Start(); + try + { + var response = await _flexComponentRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), flexComponentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FlexComponentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponents_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentCollection.Get"); + scope.Start(); + try + { + var response = _flexComponentRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), flexComponentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FlexComponentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List FlexComponent resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents + /// + /// + /// Operation Id + /// FlexComponents_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// If provided, filters the results for the given shape. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(SystemShape? shape = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _flexComponentRestClient.CreateListByParentRequest(Id.SubscriptionId, new AzureLocation(_location), shape); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _flexComponentRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location), shape); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FlexComponentResource(Client, FlexComponentData.DeserializeFlexComponentData(e)), _flexComponentClientDiagnostics, Pipeline, "FlexComponentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List FlexComponent resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents + /// + /// + /// Operation Id + /// FlexComponents_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// If provided, filters the results for the given shape. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(SystemShape? shape = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _flexComponentRestClient.CreateListByParentRequest(Id.SubscriptionId, new AzureLocation(_location), shape); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _flexComponentRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location), shape); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FlexComponentResource(Client, FlexComponentData.DeserializeFlexComponentData(e)), _flexComponentClientDiagnostics, Pipeline, "FlexComponentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponents_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentCollection.Exists"); + scope.Start(); + try + { + var response = await _flexComponentRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), flexComponentName, 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}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponents_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentCollection.Exists"); + scope.Start(); + try + { + var response = _flexComponentRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), flexComponentName, 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}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponents_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _flexComponentRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), flexComponentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FlexComponentResource(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}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponents_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _flexComponentRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), flexComponentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FlexComponentResource(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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.Serialization.cs new file mode 100644 index 000000000000..b42120201bca --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class FlexComponentData : 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(FlexComponentData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FlexComponentData 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(FlexComponentData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFlexComponentData(document.RootElement, options); + } + + internal static FlexComponentData DeserializeFlexComponentData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FlexComponentProperties 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 = FlexComponentProperties.DeserializeFlexComponentProperties(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 FlexComponentData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FlexComponentData)} does not support writing '{options.Format}' format."); + } + } + + FlexComponentData 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 DeserializeFlexComponentData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FlexComponentData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.cs new file mode 100644 index 000000000000..bd361073797d --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the FlexComponent data model. + /// FlexComponent Resource Definition + /// + public partial class FlexComponentData : 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 FlexComponentData() + { + } + + /// 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 FlexComponentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, FlexComponentProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public FlexComponentProperties Properties { get; set; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.Serialization.cs new file mode 100644 index 000000000000..0b685efb8e37 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.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.OracleDatabase +{ + public partial class FlexComponentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FlexComponentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FlexComponentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.cs new file mode 100644 index 000000000000..47afea4f6209 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.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; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing a FlexComponent 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 GetFlexComponentResource method. + /// Otherwise you can get one from its parent resource using the GetFlexComponent method. + /// + public partial class FlexComponentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The location. + /// The flexComponentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string flexComponentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _flexComponentClientDiagnostics; + private readonly FlexComponentsRestOperations _flexComponentRestClient; + private readonly FlexComponentData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/locations/flexComponents"; + + /// Initializes a new instance of the class for mocking. + protected FlexComponentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FlexComponentResource(ArmClient client, FlexComponentData 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 FlexComponentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _flexComponentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string flexComponentApiVersion); + _flexComponentRestClient = new FlexComponentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, flexComponentApiVersion); +#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 FlexComponentData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponents_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentResource.Get"); + scope.Start(); + try + { + var response = await _flexComponentRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FlexComponentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponents_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentResource.Get"); + scope.Start(); + try + { + var response = _flexComponentRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FlexComponentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionCollection.cs new file mode 100644 index 000000000000..a635f33d7300 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionCollection.cs @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// 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 GetGiMinorVersions method from an instance of . + /// + public partial class GiMinorVersionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _giMinorVersionClientDiagnostics; + private readonly GiMinorVersionsRestOperations _giMinorVersionRestClient; + + /// Initializes a new instance of the class for mocking. + protected GiMinorVersionCollection() + { + } + + /// 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 GiMinorVersionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _giMinorVersionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", GiMinorVersionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(GiMinorVersionResource.ResourceType, out string giMinorVersionApiVersion); + _giMinorVersionRestClient = new GiMinorVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, giMinorVersionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != OracleGIVersionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, OracleGIVersionResource.ResourceType), nameof(id)); + } + + /// + /// Get a GiMinorVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersions_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionCollection.Get"); + scope.Start(); + try + { + var response = await _giMinorVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, giMinorVersionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GiMinorVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a GiMinorVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersions_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionCollection.Get"); + scope.Start(); + try + { + var response = _giMinorVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, giMinorVersionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GiMinorVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List GiMinorVersion resources by GiVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions + /// + /// + /// Operation Id + /// GiMinorVersions_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// If provided, filters the results to the set of database versions which are supported for the given shape family. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(ShapeFamily? shapeFamily = null, string zone = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _giMinorVersionRestClient.CreateListByParentRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, shapeFamily, zone); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _giMinorVersionRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, shapeFamily, zone); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GiMinorVersionResource(Client, GiMinorVersionData.DeserializeGiMinorVersionData(e)), _giMinorVersionClientDiagnostics, Pipeline, "GiMinorVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List GiMinorVersion resources by GiVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions + /// + /// + /// Operation Id + /// GiMinorVersions_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// If provided, filters the results to the set of database versions which are supported for the given shape family. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(ShapeFamily? shapeFamily = null, string zone = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _giMinorVersionRestClient.CreateListByParentRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, shapeFamily, zone); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _giMinorVersionRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, shapeFamily, zone); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GiMinorVersionResource(Client, GiMinorVersionData.DeserializeGiMinorVersionData(e)), _giMinorVersionClientDiagnostics, Pipeline, "GiMinorVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersions_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionCollection.Exists"); + scope.Start(); + try + { + var response = await _giMinorVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, giMinorVersionName, 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}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersions_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionCollection.Exists"); + scope.Start(); + try + { + var response = _giMinorVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, giMinorVersionName, 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}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersions_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _giMinorVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, giMinorVersionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GiMinorVersionResource(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}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersions_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _giMinorVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, giMinorVersionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GiMinorVersionResource(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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.Serialization.cs new file mode 100644 index 000000000000..e073f2df5ad7 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class GiMinorVersionData : 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(GiMinorVersionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + GiMinorVersionData 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(GiMinorVersionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGiMinorVersionData(document.RootElement, options); + } + + internal static GiMinorVersionData DeserializeGiMinorVersionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + GiMinorVersionProperties 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 = GiMinorVersionProperties.DeserializeGiMinorVersionProperties(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 GiMinorVersionData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GiMinorVersionData)} does not support writing '{options.Format}' format."); + } + } + + GiMinorVersionData 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 DeserializeGiMinorVersionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GiMinorVersionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.cs new file mode 100644 index 000000000000..5c6514a4a0e0 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the GiMinorVersion data model. + /// The Oracle Grid Infrastructure (GI) minor version resource definition. + /// + public partial class GiMinorVersionData : 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 GiMinorVersionData() + { + } + + /// 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 GiMinorVersionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, GiMinorVersionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public GiMinorVersionProperties Properties { get; set; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.Serialization.cs new file mode 100644 index 000000000000..61d5861b314c --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.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.OracleDatabase +{ + public partial class GiMinorVersionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + GiMinorVersionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + GiMinorVersionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.cs new file mode 100644 index 000000000000..d7b49e1ce3b9 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.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.OracleDatabase +{ + /// + /// A Class representing a GiMinorVersion 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 GetGiMinorVersionResource method. + /// Otherwise you can get one from its parent resource using the GetGiMinorVersion method. + /// + public partial class GiMinorVersionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The location. + /// The giversionname. + /// The giMinorVersionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string giversionname, string giMinorVersionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _giMinorVersionClientDiagnostics; + private readonly GiMinorVersionsRestOperations _giMinorVersionRestClient; + private readonly GiMinorVersionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/locations/giVersions/giMinorVersions"; + + /// Initializes a new instance of the class for mocking. + protected GiMinorVersionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal GiMinorVersionResource(ArmClient client, GiMinorVersionData 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 GiMinorVersionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _giMinorVersionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string giMinorVersionApiVersion); + _giMinorVersionRestClient = new GiMinorVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, giMinorVersionApiVersion); +#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 GiMinorVersionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a GiMinorVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersions_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionResource.Get"); + scope.Start(); + try + { + var response = await _giMinorVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(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 GiMinorVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a GiMinorVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersions_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionResource.Get"); + scope.Start(); + try + { + var response = _giMinorVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GiMinorVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/DBActionResponseOperationSource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/DBActionResponseOperationSource.cs new file mode 100644 index 000000000000..88689317c065 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/DBActionResponseOperationSource.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal class DBActionResponseOperationSource : IOperationSource + { + DBActionResponse IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return DBActionResponse.DeserializeDBActionResponse(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return DBActionResponse.DeserializeDBActionResponse(document.RootElement); + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExadbVmClusterOperationSource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExadbVmClusterOperationSource.cs new file mode 100644 index 000000000000..b0970ce98262 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExadbVmClusterOperationSource.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.OracleDatabase +{ + internal class ExadbVmClusterOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ExadbVmClusterOperationSource(ArmClient client) + { + _client = client; + } + + ExadbVmClusterResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new ExadbVmClusterResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new ExadbVmClusterResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExascaleDBStorageVaultOperationSource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExascaleDBStorageVaultOperationSource.cs new file mode 100644 index 000000000000..b253cc2cdc0a --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExascaleDBStorageVaultOperationSource.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.OracleDatabase +{ + internal class ExascaleDBStorageVaultOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ExascaleDBStorageVaultOperationSource(ArmClient client) + { + _client = client; + } + + ExascaleDBStorageVaultResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new ExascaleDBStorageVaultResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new ExascaleDBStorageVaultResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddSubscriptionOperationState.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddSubscriptionOperationState.cs new file mode 100644 index 000000000000..29255876381b --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddSubscriptionOperationState.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.OracleDatabase.Models +{ + /// Add Subscription Operation state enum. + public readonly partial struct AddSubscriptionOperationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AddSubscriptionOperationState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string UpdatingValue = "Updating"; + private const string FailedValue = "Failed"; + + /// Succeeded - State when Add Subscription operation succeeded. + public static AddSubscriptionOperationState Succeeded { get; } = new AddSubscriptionOperationState(SucceededValue); + /// Updating - State when Add Subscription operation is being Updated. + public static AddSubscriptionOperationState Updating { get; } = new AddSubscriptionOperationState(UpdatingValue); + /// Failed - State when Add Subscription operation failed. + public static AddSubscriptionOperationState Failed { get; } = new AddSubscriptionOperationState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(AddSubscriptionOperationState left, AddSubscriptionOperationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AddSubscriptionOperationState left, AddSubscriptionOperationState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AddSubscriptionOperationState(string value) => new AddSubscriptionOperationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AddSubscriptionOperationState other && Equals(other); + /// + public bool Equals(AddSubscriptionOperationState 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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDBVersionProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDBVersionProperties.Serialization.cs index e0a76723405b..a38bbafa1d8d 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDBVersionProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDBVersionProperties.Serialization.cs @@ -34,32 +34,29 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(AutonomousDBVersionProperties)} does not support writing '{format}' format."); } - if (options.Format != "W") - { - writer.WritePropertyName("version"u8); - writer.WriteStringValue(Version); - } - if (options.Format != "W" && Optional.IsDefined(DBWorkload)) + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + if (Optional.IsDefined(DBWorkload)) { writer.WritePropertyName("dbWorkload"u8); writer.WriteStringValue(DBWorkload.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(IsDefaultForFree)) + if (Optional.IsDefined(IsDefaultForFree)) { writer.WritePropertyName("isDefaultForFree"u8); writer.WriteBooleanValue(IsDefaultForFree.Value); } - if (options.Format != "W" && Optional.IsDefined(IsDefaultForPaid)) + if (Optional.IsDefined(IsDefaultForPaid)) { writer.WritePropertyName("isDefaultForPaid"u8); writer.WriteBooleanValue(IsDefaultForPaid.Value); } - if (options.Format != "W" && Optional.IsDefined(IsFreeTierEnabled)) + if (Optional.IsDefined(IsFreeTierEnabled)) { writer.WritePropertyName("isFreeTierEnabled"u8); writer.WriteBooleanValue(IsFreeTierEnabled.Value); } - if (options.Format != "W" && Optional.IsDefined(IsPaidEnabled)) + if (Optional.IsDefined(IsPaidEnabled)) { writer.WritePropertyName("isPaidEnabled"u8); writer.WriteBooleanValue(IsPaidEnabled.Value); diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDBVersionProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDBVersionProperties.cs index f621e5994b38..f6e159b37371 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDBVersionProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDBVersionProperties.cs @@ -47,8 +47,11 @@ public partial class AutonomousDBVersionProperties /// Initializes a new instance of . /// Supported Autonomous Db versions. + /// is null. public AutonomousDBVersionProperties(string version) { + Argument.AssertNotNull(version, nameof(version)); + Version = version; } @@ -77,16 +80,16 @@ internal AutonomousDBVersionProperties() } /// Supported Autonomous Db versions. - public string Version { get; } + public string Version { get; set; } /// The Autonomous Database workload type. - public AutonomousDatabaseWorkloadType? DBWorkload { get; } + public AutonomousDatabaseWorkloadType? DBWorkload { get; set; } /// True if this version of the Oracle Database software's default is free. - public bool? IsDefaultForFree { get; } + public bool? IsDefaultForFree { get; set; } /// True if this version of the Oracle Database software's default is paid. - public bool? IsDefaultForPaid { get; } + public bool? IsDefaultForPaid { get; set; } /// True if this version of the Oracle Database software can be used for Always-Free Autonomous Databases. - public bool? IsFreeTierEnabled { get; } + public bool? IsFreeTierEnabled { get; set; } /// True if this version of the Oracle Database software has payments enabled. - public bool? IsPaidEnabled { get; } + public bool? IsPaidEnabled { get; set; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseActionContent.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseActionContent.Serialization.cs index 47004467a4e4..774861e2f774 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseActionContent.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseActionContent.Serialization.cs @@ -39,6 +39,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("peerDbId"u8); writer.WriteStringValue(PeerDBId); } + if (Optional.IsDefined(PeerDBOcid)) + { + writer.WritePropertyName("peerDbOcid"u8); + writer.WriteStringValue(PeerDBOcid); + } + if (Optional.IsDefined(PeerDBLocation)) + { + writer.WritePropertyName("peerDbLocation"u8); + writer.WriteStringValue(PeerDBLocation); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -77,6 +87,8 @@ internal static AutonomousDatabaseActionContent DeserializeAutonomousDatabaseAct return null; } string peerDBId = default; + string peerDBOcid = default; + string peerDBLocation = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -86,13 +98,23 @@ internal static AutonomousDatabaseActionContent DeserializeAutonomousDatabaseAct peerDBId = property.Value.GetString(); continue; } + if (property.NameEquals("peerDbOcid"u8)) + { + peerDBOcid = property.Value.GetString(); + continue; + } + if (property.NameEquals("peerDbLocation"u8)) + { + peerDBLocation = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new AutonomousDatabaseActionContent(peerDBId, serializedAdditionalRawData); + return new AutonomousDatabaseActionContent(peerDBId, peerDBOcid, peerDBLocation, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseActionContent.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseActionContent.cs index 3207f9a0d786..20afcf4007b0 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseActionContent.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseActionContent.cs @@ -51,15 +51,23 @@ public AutonomousDatabaseActionContent() } /// Initializes a new instance of . - /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Ocid of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// The location of the Disaster Recovery peer database. /// Keeps track of any properties unknown to the library. - internal AutonomousDatabaseActionContent(string peerDBId, IDictionary serializedAdditionalRawData) + internal AutonomousDatabaseActionContent(string peerDBId, string peerDBOcid, string peerDBLocation, IDictionary serializedAdditionalRawData) { PeerDBId = peerDBId; + PeerDBOcid = peerDBOcid; + PeerDBLocation = peerDBLocation; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. public string PeerDBId { get; set; } + /// Ocid of the Disaster Recovery peer database, which is located in a different region from the current peer database. + public string PeerDBOcid { get; set; } + /// The location of the Disaster Recovery peer database. + public string PeerDBLocation { get; set; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupPatch.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupPatch.Serialization.cs index 1653b62c213d..0b9bcbe66737 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupPatch.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupPatch.Serialization.cs @@ -10,6 +10,7 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.OracleDatabase.Models { @@ -26,7 +27,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The JSON writer. /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -34,26 +35,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(AutonomousDatabaseBackupPatch)} does not support writing '{format}' format."); } + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } } AutonomousDatabaseBackupPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -76,7 +63,11 @@ internal static AutonomousDatabaseBackupPatch DeserializeAutonomousDatabaseBacku { return null; } - AutonomousDatabaseBackupUpdateProperties properties = default; + AutonomousDatabaseBackupProperties 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()) @@ -87,7 +78,31 @@ internal static AutonomousDatabaseBackupPatch DeserializeAutonomousDatabaseBacku { continue; } - properties = AutonomousDatabaseBackupUpdateProperties.DeserializeAutonomousDatabaseBackupUpdateProperties(property.Value, options); + properties = AutonomousDatabaseBackupProperties.DeserializeAutonomousDatabaseBackupProperties(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") @@ -96,7 +111,13 @@ internal static AutonomousDatabaseBackupPatch DeserializeAutonomousDatabaseBacku } } serializedAdditionalRawData = rawDataDictionary; - return new AutonomousDatabaseBackupPatch(properties, serializedAdditionalRawData); + return new AutonomousDatabaseBackupPatch( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupPatch.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupPatch.cs index a6fdfd83a508..af8bbdbf04a7 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupPatch.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupPatch.cs @@ -7,11 +7,13 @@ using System; using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; namespace Azure.ResourceManager.OracleDatabase.Models { - /// The type used for update operations of the AutonomousDatabaseBackup. - public partial class AutonomousDatabaseBackupPatch + /// AutonomousDatabaseBackup resource definition. + public partial class AutonomousDatabaseBackupPatch : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,26 +53,19 @@ public AutonomousDatabaseBackupPatch() } /// Initializes a new instance of . - /// The updatable properties of the AutonomousDatabaseBackup. + /// 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 AutonomousDatabaseBackupPatch(AutonomousDatabaseBackupUpdateProperties properties, IDictionary serializedAdditionalRawData) + internal AutonomousDatabaseBackupPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AutonomousDatabaseBackupProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The updatable properties of the AutonomousDatabaseBackup. - internal AutonomousDatabaseBackupUpdateProperties Properties { get; set; } - /// Retention period, in days, for long-term backups. - public int? AutonomousDatabaseBackupUpdateRetentionPeriodInDays - { - get => Properties is null ? default : Properties.RetentionPeriodInDays; - set - { - if (Properties is null) - Properties = new AutonomousDatabaseBackupUpdateProperties(); - Properties.RetentionPeriodInDays = value; - } - } + /// The resource-specific properties for this resource. + public AutonomousDatabaseBackupProperties Properties { get; set; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupProperties.cs index 0b4e165c69e4..a5071f45bcb9 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupProperties.cs @@ -61,7 +61,7 @@ public AutonomousDatabaseBackupProperties() /// Indicates whether the backup can be used to restore the associated Autonomous Database. /// Additional information about the current lifecycle state. /// The current state of the backup. - /// Retention period, in days, for long-term backups. + /// Retention period, in days. /// The backup size in terabytes (TB). /// Timestamp until when the backup will be available. /// The date and time the backup started. @@ -108,7 +108,7 @@ internal AutonomousDatabaseBackupProperties(ResourceIdentifier autonomousDatabas public string LifecycleDetails { get; } /// The current state of the backup. public AutonomousDatabaseBackupLifecycleState? LifecycleState { get; } - /// Retention period, in days, for long-term backups. + /// Retention period, in days. public int? RetentionPeriodInDays { get; set; } /// The backup size in terabytes (TB). public double? SizeInTbs { get; } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.Serialization.cs index 12e584b3d425..b093cac3da8d 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.Serialization.cs @@ -141,6 +141,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("localDisasterRecoveryType"u8); writer.WriteStringValue(LocalDisasterRecoveryType.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(TimeDisasterRecoveryRoleChanged)) + { + writer.WritePropertyName("timeDisasterRecoveryRoleChanged"u8); + writer.WriteStringValue(TimeDisasterRecoveryRoleChanged.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(RemoteDisasterRecoveryConfiguration)) + { + writer.WritePropertyName("remoteDisasterRecoveryConfiguration"u8); + writer.WriteObjectValue(RemoteDisasterRecoveryConfiguration, options); + } if (options.Format != "W" && Optional.IsDefined(LocalStandbyDB)) { writer.WritePropertyName("localStandbyDb"u8); @@ -478,6 +488,8 @@ internal static AutonomousDatabaseBaseProperties DeserializeAutonomousDatabaseBa switch (discriminator.GetString()) { case "Clone": return AutonomousDatabaseCloneProperties.DeserializeAutonomousDatabaseCloneProperties(element, options); + case "CloneFromBackupTimestamp": return AutonomousDatabaseFromBackupTimestampProperties.DeserializeAutonomousDatabaseFromBackupTimestampProperties(element, options); + case "CrossRegionDisasterRecovery": return AutonomousDatabaseCrossRegionDisasterRecoveryProperties.DeserializeAutonomousDatabaseCrossRegionDisasterRecoveryProperties(element, options); case "Regular": return AutonomousDatabaseProperties.DeserializeAutonomousDatabaseProperties(element, options); } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.cs index f7ed30ae5c27..b9741d251d93 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.OracleDatabase.Models /// /// Autonomous Database base resource model. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . + /// The available derived classes include , , and . /// public abstract partial class AutonomousDatabaseBaseProperties { @@ -77,11 +77,13 @@ protected AutonomousDatabaseBaseProperties() /// The user-friendly name for the Autonomous Database. /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. /// Indicates if auto scaling is enabled for the Autonomous Database storage. - /// The list of [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs. - /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. /// Local Autonomous Disaster Recovery standby database details. /// Indicates the number of seconds of data loss for a Data Guard failover. /// Specifies if the Autonomous Database requires mTLS connections. @@ -138,7 +140,7 @@ protected AutonomousDatabaseBaseProperties() /// Retention period, in days, for long-term backups. /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. /// Keeps track of any properties unknown to the library. - internal AutonomousDatabaseBaseProperties(string adminPassword, OracleDataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, AutonomousDatabaseComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, AutonomousDatabaseWorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDBIds, string peerDBId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, AutonomousDatabaseStandbySummary localStandbyDB, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, OracleLicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, OracleDatabaseProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, Uri ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? createdOn, DateTimeOffset? maintenanceBeginOn, DateTimeOffset? maintenanceEndOn, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, OracleApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, AutonomousDatabaseConnectionStrings connectionStrings, AutonomousDatabaseConnectionUrls connectionUrls, DataSafeStatusType? dataSafeStatus, OracleDatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupCreatedOn, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, AutonomousDatabaseModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, AutonomousDatabasePermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, DataGuardRoleType? role, Uri serviceConsoleUri, Uri sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, DateTimeOffset? dataGuardRoleChangedOn, DateTimeOffset? freeAutonomousDatabaseDeletedOn, string timeLocalDataGuardEnabled, DateTimeOffset? lastFailoverHappenedOn, DateTimeOffset? lastRefreshHappenedOn, DateTimeOffset? lastRefreshPointTimestamp, DateTimeOffset? lastSwitchoverHappenedOn, DateTimeOffset? freeAutonomousDatabaseStoppedOn, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, ResourceIdentifier ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData) + internal AutonomousDatabaseBaseProperties(string adminPassword, OracleDataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, AutonomousDatabaseComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, AutonomousDatabaseWorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDBIds, string peerDBId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, DateTimeOffset? timeDisasterRecoveryRoleChanged, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration, AutonomousDatabaseStandbySummary localStandbyDB, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, OracleLicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, OracleDatabaseProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, Uri ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? createdOn, DateTimeOffset? maintenanceBeginOn, DateTimeOffset? maintenanceEndOn, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, OracleApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, AutonomousDatabaseConnectionStrings connectionStrings, AutonomousDatabaseConnectionUrls connectionUrls, DataSafeStatusType? dataSafeStatus, OracleDatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupCreatedOn, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, AutonomousDatabaseModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, AutonomousDatabasePermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, DataGuardRoleType? role, Uri serviceConsoleUri, Uri sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, DateTimeOffset? dataGuardRoleChangedOn, DateTimeOffset? freeAutonomousDatabaseDeletedOn, string timeLocalDataGuardEnabled, DateTimeOffset? lastFailoverHappenedOn, DateTimeOffset? lastRefreshHappenedOn, DateTimeOffset? lastRefreshPointTimestamp, DateTimeOffset? lastSwitchoverHappenedOn, DateTimeOffset? freeAutonomousDatabaseStoppedOn, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, ResourceIdentifier ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData) { AdminPassword = adminPassword; DataBaseType = dataBaseType; @@ -160,6 +162,8 @@ internal AutonomousDatabaseBaseProperties(string adminPassword, OracleDataBaseTy IsLocalDataGuardEnabled = isLocalDataGuardEnabled; IsRemoteDataGuardEnabled = isRemoteDataGuardEnabled; LocalDisasterRecoveryType = localDisasterRecoveryType; + TimeDisasterRecoveryRoleChanged = timeDisasterRecoveryRoleChanged; + RemoteDisasterRecoveryConfiguration = remoteDisasterRecoveryConfiguration; LocalStandbyDB = localStandbyDB; FailedDataRecoveryInSeconds = failedDataRecoveryInSeconds; IsMtlsConnectionRequired = isMtlsConnectionRequired; @@ -248,9 +252,9 @@ internal AutonomousDatabaseBaseProperties(string adminPassword, OracleDataBaseTy public bool? IsAutoScalingEnabled { get; set; } /// Indicates if auto scaling is enabled for the Autonomous Database storage. public bool? IsAutoScalingForStorageEnabled { get; set; } - /// The list of [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. public IReadOnlyList PeerDBIds { get; } - /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. public string PeerDBId { get; set; } /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. public bool? IsLocalDataGuardEnabled { get; set; } @@ -258,6 +262,10 @@ internal AutonomousDatabaseBaseProperties(string adminPassword, OracleDataBaseTy public bool? IsRemoteDataGuardEnabled { get; } /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. public DisasterRecoveryType? LocalDisasterRecoveryType { get; } + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + public DateTimeOffset? TimeDisasterRecoveryRoleChanged { get; } + /// Indicates remote disaster recovery configuration. + public DisasterRecoveryConfigurationDetails RemoteDisasterRecoveryConfiguration { get; } /// Local Autonomous Disaster Recovery standby database details. public AutonomousDatabaseStandbySummary LocalStandbyDB { get; } /// Indicates the number of seconds of data loss for a Data Guard failover. diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.Serialization.cs index aafa94c51690..b91fa0e5f4ed 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.Serialization.cs @@ -34,11 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(AutonomousDatabaseCharacterSetProperties)} does not support writing '{format}' format."); } - if (options.Format != "W") - { - writer.WritePropertyName("characterSet"u8); - writer.WriteStringValue(CharacterSet); - } + writer.WritePropertyName("characterSet"u8); + writer.WriteStringValue(CharacterSet); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.cs index a1a8e1075de3..a66f49fb4df1 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.cs @@ -47,8 +47,11 @@ internal partial class AutonomousDatabaseCharacterSetProperties /// Initializes a new instance of . /// The Oracle Autonomous Database supported character sets. + /// is null. public AutonomousDatabaseCharacterSetProperties(string characterSet) { + Argument.AssertNotNull(characterSet, nameof(characterSet)); + CharacterSet = characterSet; } @@ -67,6 +70,6 @@ internal AutonomousDatabaseCharacterSetProperties() } /// The Oracle Autonomous Database supported character sets. - public string CharacterSet { get; } + public string CharacterSet { get; set; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.Serialization.cs index d2345404cad5..803d1379060b 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.Serialization.cs @@ -119,6 +119,8 @@ internal static AutonomousDatabaseCloneProperties DeserializeAutonomousDatabaseC bool? isLocalDataGuardEnabled = default; bool? isRemoteDataGuardEnabled = default; DisasterRecoveryType? localDisasterRecoveryType = default; + DateTimeOffset? timeDisasterRecoveryRoleChanged = default; + DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = default; AutonomousDatabaseStandbySummary localStandbyDB = default; int? failedDataRecoveryInSeconds = default; bool? isMtlsConnectionRequired = default; @@ -408,6 +410,24 @@ internal static AutonomousDatabaseCloneProperties DeserializeAutonomousDatabaseC localDisasterRecoveryType = new DisasterRecoveryType(property.Value.GetString()); continue; } + if (property.NameEquals("timeDisasterRecoveryRoleChanged"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeDisasterRecoveryRoleChanged = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("remoteDisasterRecoveryConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remoteDisasterRecoveryConfiguration = DisasterRecoveryConfigurationDetails.DeserializeDisasterRecoveryConfigurationDetails(property.Value, options); + continue; + } if (property.NameEquals("localStandbyDb"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -926,6 +946,8 @@ internal static AutonomousDatabaseCloneProperties DeserializeAutonomousDatabaseC isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, localStandbyDB, failedDataRecoveryInSeconds, isMtlsConnectionRequired, diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.cs index c92342137ce7..1074947b8d2e 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.OracleDatabase.Models public partial class AutonomousDatabaseCloneProperties : AutonomousDatabaseBaseProperties { /// Initializes a new instance of . - /// The Azure ID of the Autonomous Database that was cloned to create the current Autonomous Database. + /// The Azure resource ID of the Autonomous Database that was cloned to create the current Autonomous Database. /// The Autonomous Database clone type. /// is null. public AutonomousDatabaseCloneProperties(ResourceIdentifier sourceId, AutonomousDatabaseCloneType cloneType) @@ -43,11 +43,13 @@ public AutonomousDatabaseCloneProperties(ResourceIdentifier sourceId, Autonomous /// The user-friendly name for the Autonomous Database. /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. /// Indicates if auto scaling is enabled for the Autonomous Database storage. - /// The list of [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs. - /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. /// Local Autonomous Disaster Recovery standby database details. /// Indicates the number of seconds of data loss for a Data Guard failover. /// Specifies if the Autonomous Database requires mTLS connections. @@ -105,14 +107,14 @@ public AutonomousDatabaseCloneProperties(ResourceIdentifier sourceId, Autonomous /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. /// Keeps track of any properties unknown to the library. /// The source of the database. - /// The Azure ID of the Autonomous Database that was cloned to create the current Autonomous Database. + /// The Azure resource ID of the Autonomous Database that was cloned to create the current Autonomous Database. /// The Autonomous Database clone type. /// Indicates if the refreshable clone can be reconnected to its source database. /// Indicates if the Autonomous Database is a refreshable clone. /// The refresh mode of the clone. /// The refresh status of the clone. /// The time and date as an RFC3339 formatted string, e.g., 2022-01-01T12:00:00.000Z, to set the limit for a refreshable clone to be reconnected to its source database. - internal AutonomousDatabaseCloneProperties(string adminPassword, OracleDataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, AutonomousDatabaseComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, AutonomousDatabaseWorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDBIds, string peerDBId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, AutonomousDatabaseStandbySummary localStandbyDB, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, OracleLicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, OracleDatabaseProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, Uri ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? createdOn, DateTimeOffset? maintenanceBeginOn, DateTimeOffset? maintenanceEndOn, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, OracleApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, AutonomousDatabaseConnectionStrings connectionStrings, AutonomousDatabaseConnectionUrls connectionUrls, DataSafeStatusType? dataSafeStatus, OracleDatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupCreatedOn, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, AutonomousDatabaseModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, AutonomousDatabasePermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, DataGuardRoleType? role, Uri serviceConsoleUri, Uri sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, DateTimeOffset? dataGuardRoleChangedOn, DateTimeOffset? freeAutonomousDatabaseDeletedOn, string timeLocalDataGuardEnabled, DateTimeOffset? lastFailoverHappenedOn, DateTimeOffset? lastRefreshHappenedOn, DateTimeOffset? lastRefreshPointTimestamp, DateTimeOffset? lastSwitchoverHappenedOn, DateTimeOffset? freeAutonomousDatabaseStoppedOn, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, ResourceIdentifier ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData, AutonomousDatabaseSourceType? source, ResourceIdentifier sourceId, AutonomousDatabaseCloneType cloneType, bool? isReconnectCloneEnabled, bool? isRefreshableClone, RefreshableModelType? refreshableModel, RefreshableStatusType? refreshableStatus, DateTimeOffset? reconnectCloneEnabledOn) : base(adminPassword, dataBaseType, autonomousMaintenanceScheduleType, characterSet, computeCount, computeModel, cpuCoreCount, customerContacts, dataStorageSizeInTbs, dataStorageSizeInGbs, dbVersion, dbWorkload, displayName, isAutoScalingEnabled, isAutoScalingForStorageEnabled, peerDBIds, peerDBId, isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, localStandbyDB, failedDataRecoveryInSeconds, isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted, licenseModel, ncharacterSet, lifecycleDetails, provisioningState, lifecycleState, scheduledOperations, privateEndpointIP, privateEndpointLabel, ociUri, subnetId, vnetId, createdOn, maintenanceBeginOn, maintenanceEndOn, actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs, apexDetails, availableUpgradeVersions, connectionStrings, connectionUrls, dataSafeStatus, databaseEdition, autonomousDatabaseId, inMemoryAreaInGbs, nextLongTermBackupCreatedOn, longTermBackupSchedule, isPreview, localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs, openMode, operationsInsightsStatus, permissionLevel, privateEndpoint, provisionableCpus, role, serviceConsoleUri, sqlWebDeveloperUri, supportedRegionsToCloneTo, dataGuardRoleChangedOn, freeAutonomousDatabaseDeletedOn, timeLocalDataGuardEnabled, lastFailoverHappenedOn, lastRefreshHappenedOn, lastRefreshPointTimestamp, lastSwitchoverHappenedOn, freeAutonomousDatabaseStoppedOn, usedDataStorageSizeInGbs, usedDataStorageSizeInTbs, ocid, backupRetentionPeriodInDays, whitelistedIPs, serializedAdditionalRawData) + internal AutonomousDatabaseCloneProperties(string adminPassword, OracleDataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, AutonomousDatabaseComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, AutonomousDatabaseWorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDBIds, string peerDBId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, DateTimeOffset? timeDisasterRecoveryRoleChanged, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration, AutonomousDatabaseStandbySummary localStandbyDB, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, OracleLicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, OracleDatabaseProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, Uri ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? createdOn, DateTimeOffset? maintenanceBeginOn, DateTimeOffset? maintenanceEndOn, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, OracleApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, AutonomousDatabaseConnectionStrings connectionStrings, AutonomousDatabaseConnectionUrls connectionUrls, DataSafeStatusType? dataSafeStatus, OracleDatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupCreatedOn, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, AutonomousDatabaseModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, AutonomousDatabasePermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, DataGuardRoleType? role, Uri serviceConsoleUri, Uri sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, DateTimeOffset? dataGuardRoleChangedOn, DateTimeOffset? freeAutonomousDatabaseDeletedOn, string timeLocalDataGuardEnabled, DateTimeOffset? lastFailoverHappenedOn, DateTimeOffset? lastRefreshHappenedOn, DateTimeOffset? lastRefreshPointTimestamp, DateTimeOffset? lastSwitchoverHappenedOn, DateTimeOffset? freeAutonomousDatabaseStoppedOn, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, ResourceIdentifier ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData, AutonomousDatabaseSourceType? source, ResourceIdentifier sourceId, AutonomousDatabaseCloneType cloneType, bool? isReconnectCloneEnabled, bool? isRefreshableClone, RefreshableModelType? refreshableModel, RefreshableStatusType? refreshableStatus, DateTimeOffset? reconnectCloneEnabledOn) : base(adminPassword, dataBaseType, autonomousMaintenanceScheduleType, characterSet, computeCount, computeModel, cpuCoreCount, customerContacts, dataStorageSizeInTbs, dataStorageSizeInGbs, dbVersion, dbWorkload, displayName, isAutoScalingEnabled, isAutoScalingForStorageEnabled, peerDBIds, peerDBId, isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, timeDisasterRecoveryRoleChanged, remoteDisasterRecoveryConfiguration, localStandbyDB, failedDataRecoveryInSeconds, isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted, licenseModel, ncharacterSet, lifecycleDetails, provisioningState, lifecycleState, scheduledOperations, privateEndpointIP, privateEndpointLabel, ociUri, subnetId, vnetId, createdOn, maintenanceBeginOn, maintenanceEndOn, actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs, apexDetails, availableUpgradeVersions, connectionStrings, connectionUrls, dataSafeStatus, databaseEdition, autonomousDatabaseId, inMemoryAreaInGbs, nextLongTermBackupCreatedOn, longTermBackupSchedule, isPreview, localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs, openMode, operationsInsightsStatus, permissionLevel, privateEndpoint, provisionableCpus, role, serviceConsoleUri, sqlWebDeveloperUri, supportedRegionsToCloneTo, dataGuardRoleChangedOn, freeAutonomousDatabaseDeletedOn, timeLocalDataGuardEnabled, lastFailoverHappenedOn, lastRefreshHappenedOn, lastRefreshPointTimestamp, lastSwitchoverHappenedOn, freeAutonomousDatabaseStoppedOn, usedDataStorageSizeInGbs, usedDataStorageSizeInTbs, ocid, backupRetentionPeriodInDays, whitelistedIPs, serializedAdditionalRawData) { Source = source; SourceId = sourceId; @@ -132,7 +134,7 @@ internal AutonomousDatabaseCloneProperties() /// The source of the database. public AutonomousDatabaseSourceType? Source { get; set; } - /// The Azure ID of the Autonomous Database that was cloned to create the current Autonomous Database. + /// The Azure resource ID of the Autonomous Database that was cloned to create the current Autonomous Database. public ResourceIdentifier SourceId { get; set; } /// The Autonomous Database clone type. public AutonomousDatabaseCloneType CloneType { get; set; } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.Serialization.cs new file mode 100644 index 000000000000..97657710bb0f --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.Serialization.cs @@ -0,0 +1,1001 @@ +// 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.OracleDatabase.Models +{ + public partial class AutonomousDatabaseCrossRegionDisasterRecoveryProperties : 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(AutonomousDatabaseCrossRegionDisasterRecoveryProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source.ToString()); + writer.WritePropertyName("sourceId"u8); + writer.WriteStringValue(SourceId); + if (Optional.IsDefined(SourceLocation)) + { + writer.WritePropertyName("sourceLocation"u8); + writer.WriteStringValue(SourceLocation); + } + if (Optional.IsDefined(SourceOcid)) + { + writer.WritePropertyName("sourceOcid"u8); + writer.WriteStringValue(SourceOcid); + } + writer.WritePropertyName("remoteDisasterRecoveryType"u8); + writer.WriteStringValue(RemoteDisasterRecoveryType.ToString()); + if (Optional.IsDefined(IsReplicateAutomaticBackups)) + { + writer.WritePropertyName("isReplicateAutomaticBackups"u8); + writer.WriteBooleanValue(IsReplicateAutomaticBackups.Value); + } + } + + AutonomousDatabaseCrossRegionDisasterRecoveryProperties 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(AutonomousDatabaseCrossRegionDisasterRecoveryProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseCrossRegionDisasterRecoveryProperties(document.RootElement, options); + } + + internal static AutonomousDatabaseCrossRegionDisasterRecoveryProperties DeserializeAutonomousDatabaseCrossRegionDisasterRecoveryProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource source = default; + ResourceIdentifier sourceId = default; + string sourceLocation = default; + string sourceOcid = default; + DisasterRecoveryType remoteDisasterRecoveryType = default; + bool? isReplicateAutomaticBackups = default; + string adminPassword = default; + OracleDataBaseType dataBaseType = default; + AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = default; + string characterSet = default; + float? computeCount = default; + AutonomousDatabaseComputeModel? computeModel = default; + int? cpuCoreCount = default; + IList customerContacts = default; + int? dataStorageSizeInTbs = default; + int? dataStorageSizeInGbs = default; + string dbVersion = default; + AutonomousDatabaseWorkloadType? dbWorkload = default; + string displayName = default; + bool? isAutoScalingEnabled = default; + bool? isAutoScalingForStorageEnabled = default; + IReadOnlyList peerDBIds = default; + string peerDBId = default; + bool? isLocalDataGuardEnabled = default; + bool? isRemoteDataGuardEnabled = default; + DisasterRecoveryType? localDisasterRecoveryType = default; + DateTimeOffset? timeDisasterRecoveryRoleChanged = default; + DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = default; + AutonomousDatabaseStandbySummary localStandbyDB = default; + int? failedDataRecoveryInSeconds = default; + bool? isMtlsConnectionRequired = default; + bool? isPreviewVersionWithServiceTermsAccepted = default; + OracleLicenseModel? licenseModel = default; + string ncharacterSet = default; + string lifecycleDetails = default; + OracleDatabaseProvisioningState? provisioningState = default; + AutonomousDatabaseLifecycleState? lifecycleState = default; + ScheduledOperationsType scheduledOperations = default; + string privateEndpointIP = default; + string privateEndpointLabel = default; + Uri ociUrl = default; + ResourceIdentifier subnetId = default; + ResourceIdentifier vnetId = default; + DateTimeOffset? timeCreated = default; + DateTimeOffset? timeMaintenanceBegin = default; + DateTimeOffset? timeMaintenanceEnd = default; + double? actualUsedDataStorageSizeInTbs = default; + double? allocatedStorageSizeInTbs = default; + OracleApexDetailsType apexDetails = default; + IReadOnlyList availableUpgradeVersions = default; + AutonomousDatabaseConnectionStrings connectionStrings = default; + AutonomousDatabaseConnectionUrls connectionUrls = default; + DataSafeStatusType? dataSafeStatus = default; + OracleDatabaseEditionType? databaseEdition = default; + ResourceIdentifier autonomousDatabaseId = default; + int? inMemoryAreaInGbs = default; + DateTimeOffset? nextLongTermBackupTimeStamp = default; + LongTermBackUpScheduleDetails longTermBackupSchedule = default; + bool? isPreview = default; + int? localAdgAutoFailoverMaxDataLossLimit = default; + int? memoryPerOracleComputeUnitInGbs = default; + AutonomousDatabaseModeType? openMode = default; + OperationsInsightsStatusType? operationsInsightsStatus = default; + AutonomousDatabasePermissionLevelType? permissionLevel = default; + string privateEndpoint = default; + IReadOnlyList provisionableCpus = default; + DataGuardRoleType? role = default; + Uri serviceConsoleUrl = default; + Uri sqlWebDeveloperUrl = default; + IReadOnlyList supportedRegionsToCloneTo = default; + DateTimeOffset? timeDataGuardRoleChanged = default; + DateTimeOffset? timeDeletionOfFreeAutonomousDatabase = default; + string timeLocalDataGuardEnabled = default; + DateTimeOffset? timeOfLastFailover = default; + DateTimeOffset? timeOfLastRefresh = default; + DateTimeOffset? timeOfLastRefreshPoint = default; + DateTimeOffset? timeOfLastSwitchover = default; + DateTimeOffset? timeReclamationOfFreeAutonomousDatabase = default; + int? usedDataStorageSizeInGbs = default; + int? usedDataStorageSizeInTbs = default; + ResourceIdentifier ocid = default; + int? backupRetentionPeriodInDays = default; + IList whitelistedIPs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + source = new AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceId"u8)) + { + sourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceLocation"u8)) + { + sourceLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceOcid"u8)) + { + sourceOcid = property.Value.GetString(); + continue; + } + if (property.NameEquals("remoteDisasterRecoveryType"u8)) + { + remoteDisasterRecoveryType = new DisasterRecoveryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("isReplicateAutomaticBackups"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isReplicateAutomaticBackups = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("adminPassword"u8)) + { + adminPassword = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataBaseType"u8)) + { + dataBaseType = new OracleDataBaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autonomousMaintenanceScheduleType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousMaintenanceScheduleType = new AutonomousMaintenanceScheduleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("characterSet"u8)) + { + characterSet = property.Value.GetString(); + continue; + } + if (property.NameEquals("computeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeCount = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new AutonomousDatabaseComputeModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("cpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("customerContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OracleCustomerContact.DeserializeOracleCustomerContact(item, options)); + } + customerContacts = array; + continue; + } + if (property.NameEquals("dataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dbVersion"u8)) + { + dbVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("dbWorkload"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbWorkload = new AutonomousDatabaseWorkloadType(property.Value.GetString()); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isAutoScalingEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isAutoScalingForStorageEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingForStorageEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("peerDbIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + peerDBIds = array; + continue; + } + if (property.NameEquals("peerDbId"u8)) + { + peerDBId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isLocalDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isLocalDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isRemoteDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isRemoteDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("localDisasterRecoveryType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localDisasterRecoveryType = new DisasterRecoveryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeDisasterRecoveryRoleChanged"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeDisasterRecoveryRoleChanged = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("remoteDisasterRecoveryConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remoteDisasterRecoveryConfiguration = DisasterRecoveryConfigurationDetails.DeserializeDisasterRecoveryConfigurationDetails(property.Value, options); + continue; + } + if (property.NameEquals("localStandbyDb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localStandbyDB = AutonomousDatabaseStandbySummary.DeserializeAutonomousDatabaseStandbySummary(property.Value, options); + continue; + } + if (property.NameEquals("failedDataRecoveryInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failedDataRecoveryInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isMtlsConnectionRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMtlsConnectionRequired = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isPreviewVersionWithServiceTermsAccepted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPreviewVersionWithServiceTermsAccepted = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("licenseModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + licenseModel = new OracleLicenseModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("ncharacterSet"u8)) + { + ncharacterSet = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new OracleDatabaseProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new AutonomousDatabaseLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("scheduledOperations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledOperations = ScheduledOperationsType.DeserializeScheduledOperationsType(property.Value, options); + continue; + } + if (property.NameEquals("privateEndpointIp"u8)) + { + privateEndpointIP = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateEndpointLabel"u8)) + { + privateEndpointLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("ociUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ociUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceBegin"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceBegin = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceEnd"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceEnd = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("actualUsedDataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + actualUsedDataStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("allocatedStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocatedStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("apexDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + apexDetails = OracleApexDetailsType.DeserializeOracleApexDetailsType(property.Value, options); + continue; + } + if (property.NameEquals("availableUpgradeVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableUpgradeVersions = array; + continue; + } + if (property.NameEquals("connectionStrings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionStrings = AutonomousDatabaseConnectionStrings.DeserializeAutonomousDatabaseConnectionStrings(property.Value, options); + continue; + } + if (property.NameEquals("connectionUrls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionUrls = AutonomousDatabaseConnectionUrls.DeserializeAutonomousDatabaseConnectionUrls(property.Value, options); + continue; + } + if (property.NameEquals("dataSafeStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataSafeStatus = new DataSafeStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseEdition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseEdition = new OracleDatabaseEditionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autonomousDatabaseId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousDatabaseId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("inMemoryAreaInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inMemoryAreaInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nextLongTermBackupTimeStamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLongTermBackupTimeStamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("longTermBackupSchedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + longTermBackupSchedule = LongTermBackUpScheduleDetails.DeserializeLongTermBackUpScheduleDetails(property.Value, options); + continue; + } + if (property.NameEquals("isPreview"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPreview = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("localAdgAutoFailoverMaxDataLossLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localAdgAutoFailoverMaxDataLossLimit = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("memoryPerOracleComputeUnitInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memoryPerOracleComputeUnitInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("openMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + openMode = new AutonomousDatabaseModeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("operationsInsightsStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operationsInsightsStatus = new OperationsInsightsStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("permissionLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + permissionLevel = new AutonomousDatabasePermissionLevelType(property.Value.GetString()); + continue; + } + if (property.NameEquals("privateEndpoint"u8)) + { + privateEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisionableCpus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + provisionableCpus = array; + continue; + } + if (property.NameEquals("role"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + role = new DataGuardRoleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceConsoleUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceConsoleUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("sqlWebDeveloperUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sqlWebDeveloperUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("supportedRegionsToCloneTo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + supportedRegionsToCloneTo = array; + continue; + } + if (property.NameEquals("timeDataGuardRoleChanged"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeDataGuardRoleChanged = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeDeletionOfFreeAutonomousDatabase"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeDeletionOfFreeAutonomousDatabase = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeLocalDataGuardEnabled"u8)) + { + timeLocalDataGuardEnabled = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastFailover"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeOfLastFailover = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeOfLastRefresh"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeOfLastRefresh = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeOfLastRefreshPoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeOfLastRefreshPoint = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeOfLastSwitchover"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeOfLastSwitchover = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeReclamationOfFreeAutonomousDatabase"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeReclamationOfFreeAutonomousDatabase = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("usedDataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedDataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("usedDataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedDataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("ocid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ocid = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("backupRetentionPeriodInDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backupRetentionPeriodInDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("whitelistedIps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + whitelistedIPs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutonomousDatabaseCrossRegionDisasterRecoveryProperties( + adminPassword, + dataBaseType, + autonomousMaintenanceScheduleType, + characterSet, + computeCount, + computeModel, + cpuCoreCount, + customerContacts ?? new ChangeTrackingList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + dbVersion, + dbWorkload, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDBIds ?? new ChangeTrackingList(), + peerDBId, + isLocalDataGuardEnabled, + isRemoteDataGuardEnabled, + localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, + localStandbyDB, + failedDataRecoveryInSeconds, + isMtlsConnectionRequired, + isPreviewVersionWithServiceTermsAccepted, + licenseModel, + ncharacterSet, + lifecycleDetails, + provisioningState, + lifecycleState, + scheduledOperations, + privateEndpointIP, + privateEndpointLabel, + ociUrl, + subnetId, + vnetId, + timeCreated, + timeMaintenanceBegin, + timeMaintenanceEnd, + actualUsedDataStorageSizeInTbs, + allocatedStorageSizeInTbs, + apexDetails, + availableUpgradeVersions ?? new ChangeTrackingList(), + connectionStrings, + connectionUrls, + dataSafeStatus, + databaseEdition, + autonomousDatabaseId, + inMemoryAreaInGbs, + nextLongTermBackupTimeStamp, + longTermBackupSchedule, + isPreview, + localAdgAutoFailoverMaxDataLossLimit, + memoryPerOracleComputeUnitInGbs, + openMode, + operationsInsightsStatus, + permissionLevel, + privateEndpoint, + provisionableCpus ?? new ChangeTrackingList(), + role, + serviceConsoleUrl, + sqlWebDeveloperUrl, + supportedRegionsToCloneTo ?? new ChangeTrackingList(), + timeDataGuardRoleChanged, + timeDeletionOfFreeAutonomousDatabase, + timeLocalDataGuardEnabled, + timeOfLastFailover, + timeOfLastRefresh, + timeOfLastRefreshPoint, + timeOfLastSwitchover, + timeReclamationOfFreeAutonomousDatabase, + usedDataStorageSizeInGbs, + usedDataStorageSizeInTbs, + ocid, + backupRetentionPeriodInDays, + whitelistedIPs ?? new ChangeTrackingList(), + serializedAdditionalRawData, + source, + sourceId, + sourceLocation, + sourceOcid, + remoteDisasterRecoveryType, + isReplicateAutomaticBackups); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseCrossRegionDisasterRecoveryProperties)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseCrossRegionDisasterRecoveryProperties 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 DeserializeAutonomousDatabaseCrossRegionDisasterRecoveryProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseCrossRegionDisasterRecoveryProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.cs new file mode 100644 index 000000000000..3e4d6a8562c4 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.cs @@ -0,0 +1,145 @@ +// 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.OracleDatabase.Models +{ + /// Autonomous Database Cross Region Disaster Recovery resource model. + public partial class AutonomousDatabaseCrossRegionDisasterRecoveryProperties : AutonomousDatabaseBaseProperties + { + /// Initializes a new instance of . + /// The Azure ID of the source Autonomous Database that will be used to create a new peer database for the DR association. + /// Indicates the cross-region disaster recovery (DR) type of the standby Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// is null. + public AutonomousDatabaseCrossRegionDisasterRecoveryProperties(ResourceIdentifier sourceId, DisasterRecoveryType remoteDisasterRecoveryType) + { + Argument.AssertNotNull(sourceId, nameof(sourceId)); + + Source = AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource.CrossRegionDisasterRecovery; + SourceId = sourceId; + RemoteDisasterRecoveryType = remoteDisasterRecoveryType; + DataBaseType = OracleDataBaseType.CrossRegionDisasterRecovery; + } + + /// Initializes a new instance of . + /// Admin password. + /// Database type to be created. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// Keeps track of any properties unknown to the library. + /// The source of the database. + /// The Azure ID of the source Autonomous Database that will be used to create a new peer database for the DR association. + /// The name of the region where source Autonomous Database exists. + /// The source database ocid. + /// Indicates the cross-region disaster recovery (DR) type of the standby Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the backups taken on the Primary are not replicated to the Standby database. + internal AutonomousDatabaseCrossRegionDisasterRecoveryProperties(string adminPassword, OracleDataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, AutonomousDatabaseComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, AutonomousDatabaseWorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDBIds, string peerDBId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, DateTimeOffset? timeDisasterRecoveryRoleChanged, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration, AutonomousDatabaseStandbySummary localStandbyDB, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, OracleLicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, OracleDatabaseProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, Uri ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? createdOn, DateTimeOffset? maintenanceBeginOn, DateTimeOffset? maintenanceEndOn, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, OracleApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, AutonomousDatabaseConnectionStrings connectionStrings, AutonomousDatabaseConnectionUrls connectionUrls, DataSafeStatusType? dataSafeStatus, OracleDatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupCreatedOn, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, AutonomousDatabaseModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, AutonomousDatabasePermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, DataGuardRoleType? role, Uri serviceConsoleUri, Uri sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, DateTimeOffset? dataGuardRoleChangedOn, DateTimeOffset? freeAutonomousDatabaseDeletedOn, string timeLocalDataGuardEnabled, DateTimeOffset? lastFailoverHappenedOn, DateTimeOffset? lastRefreshHappenedOn, DateTimeOffset? lastRefreshPointTimestamp, DateTimeOffset? lastSwitchoverHappenedOn, DateTimeOffset? freeAutonomousDatabaseStoppedOn, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, ResourceIdentifier ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData, AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource source, ResourceIdentifier sourceId, string sourceLocation, string sourceOcid, DisasterRecoveryType remoteDisasterRecoveryType, bool? isReplicateAutomaticBackups) : base(adminPassword, dataBaseType, autonomousMaintenanceScheduleType, characterSet, computeCount, computeModel, cpuCoreCount, customerContacts, dataStorageSizeInTbs, dataStorageSizeInGbs, dbVersion, dbWorkload, displayName, isAutoScalingEnabled, isAutoScalingForStorageEnabled, peerDBIds, peerDBId, isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, timeDisasterRecoveryRoleChanged, remoteDisasterRecoveryConfiguration, localStandbyDB, failedDataRecoveryInSeconds, isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted, licenseModel, ncharacterSet, lifecycleDetails, provisioningState, lifecycleState, scheduledOperations, privateEndpointIP, privateEndpointLabel, ociUri, subnetId, vnetId, createdOn, maintenanceBeginOn, maintenanceEndOn, actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs, apexDetails, availableUpgradeVersions, connectionStrings, connectionUrls, dataSafeStatus, databaseEdition, autonomousDatabaseId, inMemoryAreaInGbs, nextLongTermBackupCreatedOn, longTermBackupSchedule, isPreview, localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs, openMode, operationsInsightsStatus, permissionLevel, privateEndpoint, provisionableCpus, role, serviceConsoleUri, sqlWebDeveloperUri, supportedRegionsToCloneTo, dataGuardRoleChangedOn, freeAutonomousDatabaseDeletedOn, timeLocalDataGuardEnabled, lastFailoverHappenedOn, lastRefreshHappenedOn, lastRefreshPointTimestamp, lastSwitchoverHappenedOn, freeAutonomousDatabaseStoppedOn, usedDataStorageSizeInGbs, usedDataStorageSizeInTbs, ocid, backupRetentionPeriodInDays, whitelistedIPs, serializedAdditionalRawData) + { + Source = source; + SourceId = sourceId; + SourceLocation = sourceLocation; + SourceOcid = sourceOcid; + RemoteDisasterRecoveryType = remoteDisasterRecoveryType; + IsReplicateAutomaticBackups = isReplicateAutomaticBackups; + DataBaseType = dataBaseType; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDatabaseCrossRegionDisasterRecoveryProperties() + { + } + + /// The source of the database. + public AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource Source { get; } + /// The Azure ID of the source Autonomous Database that will be used to create a new peer database for the DR association. + public ResourceIdentifier SourceId { get; set; } + /// The name of the region where source Autonomous Database exists. + public string SourceLocation { get; set; } + /// The source database ocid. + public string SourceOcid { get; set; } + /// Indicates the cross-region disaster recovery (DR) type of the standby Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + public DisasterRecoveryType RemoteDisasterRecoveryType { get; set; } + /// If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the backups taken on the Primary are not replicated to the Standby database. + public bool? IsReplicateAutomaticBackups { get; set; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource.cs new file mode 100644 index 000000000000..1ec7f9c7aa7f --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource.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.OracleDatabase.Models +{ + /// The source of the database. + public readonly partial struct AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CrossRegionDisasterRecoveryValue = "CrossRegionDisasterRecovery"; + + /// CrossRegionDisasterRecovery. + public static AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource CrossRegionDisasterRecovery { get; } = new AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource(CrossRegionDisasterRecoveryValue); + /// Determines if two values are the same. + public static bool operator ==(AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource left, AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource left, AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource(string value) => new AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource other && Equals(other); + /// + public bool Equals(AutonomousDatabaseCrossRegionDisasterRecoveryPropertiesSource 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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.Serialization.cs new file mode 100644 index 000000000000..ec6acb15b242 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.Serialization.cs @@ -0,0 +1,993 @@ +// 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.OracleDatabase.Models +{ + public partial class AutonomousDatabaseFromBackupTimestampProperties : 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(AutonomousDatabaseFromBackupTimestampProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source.ToString()); + writer.WritePropertyName("sourceId"u8); + writer.WriteStringValue(SourceId); + writer.WritePropertyName("cloneType"u8); + writer.WriteStringValue(CloneType.ToString()); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } + if (Optional.IsDefined(UseLatestAvailableBackupTimeStamp)) + { + writer.WritePropertyName("useLatestAvailableBackupTimeStamp"u8); + writer.WriteBooleanValue(UseLatestAvailableBackupTimeStamp.Value); + } + } + + AutonomousDatabaseFromBackupTimestampProperties 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(AutonomousDatabaseFromBackupTimestampProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseFromBackupTimestampProperties(document.RootElement, options); + } + + internal static AutonomousDatabaseFromBackupTimestampProperties DeserializeAutonomousDatabaseFromBackupTimestampProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AutonomousDatabaseFromBackupTimestampPropertiesSource source = default; + ResourceIdentifier sourceId = default; + AutonomousDatabaseCloneType cloneType = default; + DateTimeOffset? timestamp = default; + bool? useLatestAvailableBackupTimeStamp = default; + string adminPassword = default; + OracleDataBaseType dataBaseType = default; + AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = default; + string characterSet = default; + float? computeCount = default; + AutonomousDatabaseComputeModel? computeModel = default; + int? cpuCoreCount = default; + IList customerContacts = default; + int? dataStorageSizeInTbs = default; + int? dataStorageSizeInGbs = default; + string dbVersion = default; + AutonomousDatabaseWorkloadType? dbWorkload = default; + string displayName = default; + bool? isAutoScalingEnabled = default; + bool? isAutoScalingForStorageEnabled = default; + IReadOnlyList peerDBIds = default; + string peerDBId = default; + bool? isLocalDataGuardEnabled = default; + bool? isRemoteDataGuardEnabled = default; + DisasterRecoveryType? localDisasterRecoveryType = default; + DateTimeOffset? timeDisasterRecoveryRoleChanged = default; + DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = default; + AutonomousDatabaseStandbySummary localStandbyDB = default; + int? failedDataRecoveryInSeconds = default; + bool? isMtlsConnectionRequired = default; + bool? isPreviewVersionWithServiceTermsAccepted = default; + OracleLicenseModel? licenseModel = default; + string ncharacterSet = default; + string lifecycleDetails = default; + OracleDatabaseProvisioningState? provisioningState = default; + AutonomousDatabaseLifecycleState? lifecycleState = default; + ScheduledOperationsType scheduledOperations = default; + string privateEndpointIP = default; + string privateEndpointLabel = default; + Uri ociUrl = default; + ResourceIdentifier subnetId = default; + ResourceIdentifier vnetId = default; + DateTimeOffset? timeCreated = default; + DateTimeOffset? timeMaintenanceBegin = default; + DateTimeOffset? timeMaintenanceEnd = default; + double? actualUsedDataStorageSizeInTbs = default; + double? allocatedStorageSizeInTbs = default; + OracleApexDetailsType apexDetails = default; + IReadOnlyList availableUpgradeVersions = default; + AutonomousDatabaseConnectionStrings connectionStrings = default; + AutonomousDatabaseConnectionUrls connectionUrls = default; + DataSafeStatusType? dataSafeStatus = default; + OracleDatabaseEditionType? databaseEdition = default; + ResourceIdentifier autonomousDatabaseId = default; + int? inMemoryAreaInGbs = default; + DateTimeOffset? nextLongTermBackupTimeStamp = default; + LongTermBackUpScheduleDetails longTermBackupSchedule = default; + bool? isPreview = default; + int? localAdgAutoFailoverMaxDataLossLimit = default; + int? memoryPerOracleComputeUnitInGbs = default; + AutonomousDatabaseModeType? openMode = default; + OperationsInsightsStatusType? operationsInsightsStatus = default; + AutonomousDatabasePermissionLevelType? permissionLevel = default; + string privateEndpoint = default; + IReadOnlyList provisionableCpus = default; + DataGuardRoleType? role = default; + Uri serviceConsoleUrl = default; + Uri sqlWebDeveloperUrl = default; + IReadOnlyList supportedRegionsToCloneTo = default; + DateTimeOffset? timeDataGuardRoleChanged = default; + DateTimeOffset? timeDeletionOfFreeAutonomousDatabase = default; + string timeLocalDataGuardEnabled = default; + DateTimeOffset? timeOfLastFailover = default; + DateTimeOffset? timeOfLastRefresh = default; + DateTimeOffset? timeOfLastRefreshPoint = default; + DateTimeOffset? timeOfLastSwitchover = default; + DateTimeOffset? timeReclamationOfFreeAutonomousDatabase = default; + int? usedDataStorageSizeInGbs = default; + int? usedDataStorageSizeInTbs = default; + ResourceIdentifier ocid = default; + int? backupRetentionPeriodInDays = default; + IList whitelistedIPs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + source = new AutonomousDatabaseFromBackupTimestampPropertiesSource(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceId"u8)) + { + sourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("cloneType"u8)) + { + cloneType = new AutonomousDatabaseCloneType(property.Value.GetString()); + continue; + } + if (property.NameEquals("timestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("useLatestAvailableBackupTimeStamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useLatestAvailableBackupTimeStamp = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("adminPassword"u8)) + { + adminPassword = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataBaseType"u8)) + { + dataBaseType = new OracleDataBaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autonomousMaintenanceScheduleType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousMaintenanceScheduleType = new AutonomousMaintenanceScheduleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("characterSet"u8)) + { + characterSet = property.Value.GetString(); + continue; + } + if (property.NameEquals("computeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeCount = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new AutonomousDatabaseComputeModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("cpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("customerContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OracleCustomerContact.DeserializeOracleCustomerContact(item, options)); + } + customerContacts = array; + continue; + } + if (property.NameEquals("dataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dbVersion"u8)) + { + dbVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("dbWorkload"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbWorkload = new AutonomousDatabaseWorkloadType(property.Value.GetString()); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isAutoScalingEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isAutoScalingForStorageEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingForStorageEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("peerDbIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + peerDBIds = array; + continue; + } + if (property.NameEquals("peerDbId"u8)) + { + peerDBId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isLocalDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isLocalDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isRemoteDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isRemoteDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("localDisasterRecoveryType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localDisasterRecoveryType = new DisasterRecoveryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeDisasterRecoveryRoleChanged"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeDisasterRecoveryRoleChanged = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("remoteDisasterRecoveryConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remoteDisasterRecoveryConfiguration = DisasterRecoveryConfigurationDetails.DeserializeDisasterRecoveryConfigurationDetails(property.Value, options); + continue; + } + if (property.NameEquals("localStandbyDb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localStandbyDB = AutonomousDatabaseStandbySummary.DeserializeAutonomousDatabaseStandbySummary(property.Value, options); + continue; + } + if (property.NameEquals("failedDataRecoveryInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failedDataRecoveryInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isMtlsConnectionRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMtlsConnectionRequired = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isPreviewVersionWithServiceTermsAccepted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPreviewVersionWithServiceTermsAccepted = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("licenseModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + licenseModel = new OracleLicenseModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("ncharacterSet"u8)) + { + ncharacterSet = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new OracleDatabaseProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new AutonomousDatabaseLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("scheduledOperations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledOperations = ScheduledOperationsType.DeserializeScheduledOperationsType(property.Value, options); + continue; + } + if (property.NameEquals("privateEndpointIp"u8)) + { + privateEndpointIP = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateEndpointLabel"u8)) + { + privateEndpointLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("ociUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ociUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceBegin"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceBegin = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceEnd"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceEnd = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("actualUsedDataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + actualUsedDataStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("allocatedStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocatedStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("apexDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + apexDetails = OracleApexDetailsType.DeserializeOracleApexDetailsType(property.Value, options); + continue; + } + if (property.NameEquals("availableUpgradeVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableUpgradeVersions = array; + continue; + } + if (property.NameEquals("connectionStrings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionStrings = AutonomousDatabaseConnectionStrings.DeserializeAutonomousDatabaseConnectionStrings(property.Value, options); + continue; + } + if (property.NameEquals("connectionUrls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionUrls = AutonomousDatabaseConnectionUrls.DeserializeAutonomousDatabaseConnectionUrls(property.Value, options); + continue; + } + if (property.NameEquals("dataSafeStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataSafeStatus = new DataSafeStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseEdition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseEdition = new OracleDatabaseEditionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autonomousDatabaseId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousDatabaseId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("inMemoryAreaInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inMemoryAreaInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nextLongTermBackupTimeStamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLongTermBackupTimeStamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("longTermBackupSchedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + longTermBackupSchedule = LongTermBackUpScheduleDetails.DeserializeLongTermBackUpScheduleDetails(property.Value, options); + continue; + } + if (property.NameEquals("isPreview"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPreview = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("localAdgAutoFailoverMaxDataLossLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localAdgAutoFailoverMaxDataLossLimit = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("memoryPerOracleComputeUnitInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memoryPerOracleComputeUnitInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("openMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + openMode = new AutonomousDatabaseModeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("operationsInsightsStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operationsInsightsStatus = new OperationsInsightsStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("permissionLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + permissionLevel = new AutonomousDatabasePermissionLevelType(property.Value.GetString()); + continue; + } + if (property.NameEquals("privateEndpoint"u8)) + { + privateEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisionableCpus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + provisionableCpus = array; + continue; + } + if (property.NameEquals("role"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + role = new DataGuardRoleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceConsoleUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceConsoleUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("sqlWebDeveloperUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sqlWebDeveloperUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("supportedRegionsToCloneTo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + supportedRegionsToCloneTo = array; + continue; + } + if (property.NameEquals("timeDataGuardRoleChanged"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeDataGuardRoleChanged = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeDeletionOfFreeAutonomousDatabase"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeDeletionOfFreeAutonomousDatabase = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeLocalDataGuardEnabled"u8)) + { + timeLocalDataGuardEnabled = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastFailover"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeOfLastFailover = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeOfLastRefresh"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeOfLastRefresh = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeOfLastRefreshPoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeOfLastRefreshPoint = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeOfLastSwitchover"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeOfLastSwitchover = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeReclamationOfFreeAutonomousDatabase"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeReclamationOfFreeAutonomousDatabase = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("usedDataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedDataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("usedDataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedDataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("ocid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ocid = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("backupRetentionPeriodInDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backupRetentionPeriodInDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("whitelistedIps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + whitelistedIPs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutonomousDatabaseFromBackupTimestampProperties( + adminPassword, + dataBaseType, + autonomousMaintenanceScheduleType, + characterSet, + computeCount, + computeModel, + cpuCoreCount, + customerContacts ?? new ChangeTrackingList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + dbVersion, + dbWorkload, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDBIds ?? new ChangeTrackingList(), + peerDBId, + isLocalDataGuardEnabled, + isRemoteDataGuardEnabled, + localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, + localStandbyDB, + failedDataRecoveryInSeconds, + isMtlsConnectionRequired, + isPreviewVersionWithServiceTermsAccepted, + licenseModel, + ncharacterSet, + lifecycleDetails, + provisioningState, + lifecycleState, + scheduledOperations, + privateEndpointIP, + privateEndpointLabel, + ociUrl, + subnetId, + vnetId, + timeCreated, + timeMaintenanceBegin, + timeMaintenanceEnd, + actualUsedDataStorageSizeInTbs, + allocatedStorageSizeInTbs, + apexDetails, + availableUpgradeVersions ?? new ChangeTrackingList(), + connectionStrings, + connectionUrls, + dataSafeStatus, + databaseEdition, + autonomousDatabaseId, + inMemoryAreaInGbs, + nextLongTermBackupTimeStamp, + longTermBackupSchedule, + isPreview, + localAdgAutoFailoverMaxDataLossLimit, + memoryPerOracleComputeUnitInGbs, + openMode, + operationsInsightsStatus, + permissionLevel, + privateEndpoint, + provisionableCpus ?? new ChangeTrackingList(), + role, + serviceConsoleUrl, + sqlWebDeveloperUrl, + supportedRegionsToCloneTo ?? new ChangeTrackingList(), + timeDataGuardRoleChanged, + timeDeletionOfFreeAutonomousDatabase, + timeLocalDataGuardEnabled, + timeOfLastFailover, + timeOfLastRefresh, + timeOfLastRefreshPoint, + timeOfLastSwitchover, + timeReclamationOfFreeAutonomousDatabase, + usedDataStorageSizeInGbs, + usedDataStorageSizeInTbs, + ocid, + backupRetentionPeriodInDays, + whitelistedIPs ?? new ChangeTrackingList(), + serializedAdditionalRawData, + source, + sourceId, + cloneType, + timestamp, + useLatestAvailableBackupTimeStamp); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseFromBackupTimestampProperties)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseFromBackupTimestampProperties 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 DeserializeAutonomousDatabaseFromBackupTimestampProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseFromBackupTimestampProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.cs new file mode 100644 index 000000000000..73160b5926e5 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.cs @@ -0,0 +1,141 @@ +// 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.OracleDatabase.Models +{ + /// Autonomous Database From Backup Timestamp resource model. + public partial class AutonomousDatabaseFromBackupTimestampProperties : AutonomousDatabaseBaseProperties + { + /// Initializes a new instance of . + /// The ID of the source Autonomous Database that you will clone to create a new Autonomous Database. + /// The Autonomous Database clone type. + /// is null. + public AutonomousDatabaseFromBackupTimestampProperties(ResourceIdentifier sourceId, AutonomousDatabaseCloneType cloneType) + { + Argument.AssertNotNull(sourceId, nameof(sourceId)); + + Source = AutonomousDatabaseFromBackupTimestampPropertiesSource.BackupFromTimestamp; + SourceId = sourceId; + CloneType = cloneType; + DataBaseType = OracleDataBaseType.CloneFromBackupTimestamp; + } + + /// Initializes a new instance of . + /// Admin password. + /// Database type to be created. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// Keeps track of any properties unknown to the library. + /// The source of the database. + /// The ID of the source Autonomous Database that you will clone to create a new Autonomous Database. + /// The Autonomous Database clone type. + /// The timestamp specified for the point-in-time clone of the source Autonomous Database. The timestamp must be in the past. + /// Clone from latest available backup timestamp. + internal AutonomousDatabaseFromBackupTimestampProperties(string adminPassword, OracleDataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, AutonomousDatabaseComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, AutonomousDatabaseWorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDBIds, string peerDBId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, DateTimeOffset? timeDisasterRecoveryRoleChanged, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration, AutonomousDatabaseStandbySummary localStandbyDB, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, OracleLicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, OracleDatabaseProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, Uri ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? createdOn, DateTimeOffset? maintenanceBeginOn, DateTimeOffset? maintenanceEndOn, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, OracleApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, AutonomousDatabaseConnectionStrings connectionStrings, AutonomousDatabaseConnectionUrls connectionUrls, DataSafeStatusType? dataSafeStatus, OracleDatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupCreatedOn, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, AutonomousDatabaseModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, AutonomousDatabasePermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, DataGuardRoleType? role, Uri serviceConsoleUri, Uri sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, DateTimeOffset? dataGuardRoleChangedOn, DateTimeOffset? freeAutonomousDatabaseDeletedOn, string timeLocalDataGuardEnabled, DateTimeOffset? lastFailoverHappenedOn, DateTimeOffset? lastRefreshHappenedOn, DateTimeOffset? lastRefreshPointTimestamp, DateTimeOffset? lastSwitchoverHappenedOn, DateTimeOffset? freeAutonomousDatabaseStoppedOn, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, ResourceIdentifier ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData, AutonomousDatabaseFromBackupTimestampPropertiesSource source, ResourceIdentifier sourceId, AutonomousDatabaseCloneType cloneType, DateTimeOffset? timestamp, bool? useLatestAvailableBackupTimeStamp) : base(adminPassword, dataBaseType, autonomousMaintenanceScheduleType, characterSet, computeCount, computeModel, cpuCoreCount, customerContacts, dataStorageSizeInTbs, dataStorageSizeInGbs, dbVersion, dbWorkload, displayName, isAutoScalingEnabled, isAutoScalingForStorageEnabled, peerDBIds, peerDBId, isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, timeDisasterRecoveryRoleChanged, remoteDisasterRecoveryConfiguration, localStandbyDB, failedDataRecoveryInSeconds, isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted, licenseModel, ncharacterSet, lifecycleDetails, provisioningState, lifecycleState, scheduledOperations, privateEndpointIP, privateEndpointLabel, ociUri, subnetId, vnetId, createdOn, maintenanceBeginOn, maintenanceEndOn, actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs, apexDetails, availableUpgradeVersions, connectionStrings, connectionUrls, dataSafeStatus, databaseEdition, autonomousDatabaseId, inMemoryAreaInGbs, nextLongTermBackupCreatedOn, longTermBackupSchedule, isPreview, localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs, openMode, operationsInsightsStatus, permissionLevel, privateEndpoint, provisionableCpus, role, serviceConsoleUri, sqlWebDeveloperUri, supportedRegionsToCloneTo, dataGuardRoleChangedOn, freeAutonomousDatabaseDeletedOn, timeLocalDataGuardEnabled, lastFailoverHappenedOn, lastRefreshHappenedOn, lastRefreshPointTimestamp, lastSwitchoverHappenedOn, freeAutonomousDatabaseStoppedOn, usedDataStorageSizeInGbs, usedDataStorageSizeInTbs, ocid, backupRetentionPeriodInDays, whitelistedIPs, serializedAdditionalRawData) + { + Source = source; + SourceId = sourceId; + CloneType = cloneType; + Timestamp = timestamp; + UseLatestAvailableBackupTimeStamp = useLatestAvailableBackupTimeStamp; + DataBaseType = dataBaseType; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDatabaseFromBackupTimestampProperties() + { + } + + /// The source of the database. + public AutonomousDatabaseFromBackupTimestampPropertiesSource Source { get; } + /// The ID of the source Autonomous Database that you will clone to create a new Autonomous Database. + public ResourceIdentifier SourceId { get; set; } + /// The Autonomous Database clone type. + public AutonomousDatabaseCloneType CloneType { get; set; } + /// The timestamp specified for the point-in-time clone of the source Autonomous Database. The timestamp must be in the past. + public DateTimeOffset? Timestamp { get; set; } + /// Clone from latest available backup timestamp. + public bool? UseLatestAvailableBackupTimeStamp { get; set; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampPropertiesSource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampPropertiesSource.cs new file mode 100644 index 000000000000..9daa22bcfd77 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampPropertiesSource.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.OracleDatabase.Models +{ + /// The source of the database. + public readonly partial struct AutonomousDatabaseFromBackupTimestampPropertiesSource : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutonomousDatabaseFromBackupTimestampPropertiesSource(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BackupFromTimestampValue = "BackupFromTimestamp"; + + /// BackupFromTimestamp. + public static AutonomousDatabaseFromBackupTimestampPropertiesSource BackupFromTimestamp { get; } = new AutonomousDatabaseFromBackupTimestampPropertiesSource(BackupFromTimestampValue); + /// Determines if two values are the same. + public static bool operator ==(AutonomousDatabaseFromBackupTimestampPropertiesSource left, AutonomousDatabaseFromBackupTimestampPropertiesSource right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutonomousDatabaseFromBackupTimestampPropertiesSource left, AutonomousDatabaseFromBackupTimestampPropertiesSource right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutonomousDatabaseFromBackupTimestampPropertiesSource(string value) => new AutonomousDatabaseFromBackupTimestampPropertiesSource(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutonomousDatabaseFromBackupTimestampPropertiesSource other && Equals(other); + /// + public bool Equals(AutonomousDatabaseFromBackupTimestampPropertiesSource 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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.Serialization.cs index 1790b2599b0e..142187ebfe3b 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.Serialization.cs @@ -34,11 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(AutonomousDatabaseNationalCharacterSetProperties)} does not support writing '{format}' format."); } - if (options.Format != "W") - { - writer.WritePropertyName("characterSet"u8); - writer.WriteStringValue(CharacterSet); - } + writer.WritePropertyName("characterSet"u8); + writer.WriteStringValue(CharacterSet); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.cs index 6992133934c3..89c316e07d6b 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.cs @@ -47,8 +47,11 @@ internal partial class AutonomousDatabaseNationalCharacterSetProperties /// Initializes a new instance of . /// The Oracle Autonomous Database supported national character sets. + /// is null. public AutonomousDatabaseNationalCharacterSetProperties(string characterSet) { + Argument.AssertNotNull(characterSet, nameof(characterSet)); + CharacterSet = characterSet; } @@ -67,6 +70,6 @@ internal AutonomousDatabaseNationalCharacterSetProperties() } /// The Oracle Autonomous Database supported national character sets. - public string CharacterSet { get; } + public string CharacterSet { get; set; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabasePatch.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabasePatch.cs index 12e7d7e5f6d6..0a6d36756b5c 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabasePatch.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabasePatch.cs @@ -53,7 +53,7 @@ public AutonomousDatabasePatch() /// Initializes a new instance of . /// Resource tags. - /// The updatable properties of the AutonomousDatabase. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. internal AutonomousDatabasePatch(IDictionary tags, AutonomousDatabaseUpdateProperties properties, IDictionary serializedAdditionalRawData) { @@ -64,7 +64,7 @@ internal AutonomousDatabasePatch(IDictionary tags, AutonomousDat /// Resource tags. public IDictionary Tags { get; } - /// The updatable properties of the AutonomousDatabase. + /// The resource-specific properties for this resource. public AutonomousDatabaseUpdateProperties Properties { get; set; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.Serialization.cs index 67ed5a61d086..77358d4a598a 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.Serialization.cs @@ -77,6 +77,8 @@ internal static AutonomousDatabaseProperties DeserializeAutonomousDatabaseProper bool? isLocalDataGuardEnabled = default; bool? isRemoteDataGuardEnabled = default; DisasterRecoveryType? localDisasterRecoveryType = default; + DateTimeOffset? timeDisasterRecoveryRoleChanged = default; + DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = default; AutonomousDatabaseStandbySummary localStandbyDB = default; int? failedDataRecoveryInSeconds = default; bool? isMtlsConnectionRequired = default; @@ -302,6 +304,24 @@ internal static AutonomousDatabaseProperties DeserializeAutonomousDatabaseProper localDisasterRecoveryType = new DisasterRecoveryType(property.Value.GetString()); continue; } + if (property.NameEquals("timeDisasterRecoveryRoleChanged"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeDisasterRecoveryRoleChanged = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("remoteDisasterRecoveryConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remoteDisasterRecoveryConfiguration = DisasterRecoveryConfigurationDetails.DeserializeDisasterRecoveryConfigurationDetails(property.Value, options); + continue; + } if (property.NameEquals("localStandbyDb"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -820,6 +840,8 @@ internal static AutonomousDatabaseProperties DeserializeAutonomousDatabaseProper isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, localStandbyDB, failedDataRecoveryInSeconds, isMtlsConnectionRequired, diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.cs index 275e9ac85be7..1f50edfec063 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.cs @@ -36,11 +36,13 @@ public AutonomousDatabaseProperties() /// The user-friendly name for the Autonomous Database. /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. /// Indicates if auto scaling is enabled for the Autonomous Database storage. - /// The list of [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs. - /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. /// Local Autonomous Disaster Recovery standby database details. /// Indicates the number of seconds of data loss for a Data Guard failover. /// Specifies if the Autonomous Database requires mTLS connections. @@ -97,7 +99,7 @@ public AutonomousDatabaseProperties() /// Retention period, in days, for long-term backups. /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. /// Keeps track of any properties unknown to the library. - internal AutonomousDatabaseProperties(string adminPassword, OracleDataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, AutonomousDatabaseComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, AutonomousDatabaseWorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDBIds, string peerDBId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, AutonomousDatabaseStandbySummary localStandbyDB, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, OracleLicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, OracleDatabaseProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, Uri ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? createdOn, DateTimeOffset? maintenanceBeginOn, DateTimeOffset? maintenanceEndOn, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, OracleApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, AutonomousDatabaseConnectionStrings connectionStrings, AutonomousDatabaseConnectionUrls connectionUrls, DataSafeStatusType? dataSafeStatus, OracleDatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupCreatedOn, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, AutonomousDatabaseModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, AutonomousDatabasePermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, DataGuardRoleType? role, Uri serviceConsoleUri, Uri sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, DateTimeOffset? dataGuardRoleChangedOn, DateTimeOffset? freeAutonomousDatabaseDeletedOn, string timeLocalDataGuardEnabled, DateTimeOffset? lastFailoverHappenedOn, DateTimeOffset? lastRefreshHappenedOn, DateTimeOffset? lastRefreshPointTimestamp, DateTimeOffset? lastSwitchoverHappenedOn, DateTimeOffset? freeAutonomousDatabaseStoppedOn, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, ResourceIdentifier ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData) : base(adminPassword, dataBaseType, autonomousMaintenanceScheduleType, characterSet, computeCount, computeModel, cpuCoreCount, customerContacts, dataStorageSizeInTbs, dataStorageSizeInGbs, dbVersion, dbWorkload, displayName, isAutoScalingEnabled, isAutoScalingForStorageEnabled, peerDBIds, peerDBId, isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, localStandbyDB, failedDataRecoveryInSeconds, isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted, licenseModel, ncharacterSet, lifecycleDetails, provisioningState, lifecycleState, scheduledOperations, privateEndpointIP, privateEndpointLabel, ociUri, subnetId, vnetId, createdOn, maintenanceBeginOn, maintenanceEndOn, actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs, apexDetails, availableUpgradeVersions, connectionStrings, connectionUrls, dataSafeStatus, databaseEdition, autonomousDatabaseId, inMemoryAreaInGbs, nextLongTermBackupCreatedOn, longTermBackupSchedule, isPreview, localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs, openMode, operationsInsightsStatus, permissionLevel, privateEndpoint, provisionableCpus, role, serviceConsoleUri, sqlWebDeveloperUri, supportedRegionsToCloneTo, dataGuardRoleChangedOn, freeAutonomousDatabaseDeletedOn, timeLocalDataGuardEnabled, lastFailoverHappenedOn, lastRefreshHappenedOn, lastRefreshPointTimestamp, lastSwitchoverHappenedOn, freeAutonomousDatabaseStoppedOn, usedDataStorageSizeInGbs, usedDataStorageSizeInTbs, ocid, backupRetentionPeriodInDays, whitelistedIPs, serializedAdditionalRawData) + internal AutonomousDatabaseProperties(string adminPassword, OracleDataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, AutonomousDatabaseComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, AutonomousDatabaseWorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDBIds, string peerDBId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, DateTimeOffset? timeDisasterRecoveryRoleChanged, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration, AutonomousDatabaseStandbySummary localStandbyDB, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, OracleLicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, OracleDatabaseProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, Uri ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? createdOn, DateTimeOffset? maintenanceBeginOn, DateTimeOffset? maintenanceEndOn, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, OracleApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, AutonomousDatabaseConnectionStrings connectionStrings, AutonomousDatabaseConnectionUrls connectionUrls, DataSafeStatusType? dataSafeStatus, OracleDatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupCreatedOn, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, AutonomousDatabaseModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, AutonomousDatabasePermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, DataGuardRoleType? role, Uri serviceConsoleUri, Uri sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, DateTimeOffset? dataGuardRoleChangedOn, DateTimeOffset? freeAutonomousDatabaseDeletedOn, string timeLocalDataGuardEnabled, DateTimeOffset? lastFailoverHappenedOn, DateTimeOffset? lastRefreshHappenedOn, DateTimeOffset? lastRefreshPointTimestamp, DateTimeOffset? lastSwitchoverHappenedOn, DateTimeOffset? freeAutonomousDatabaseStoppedOn, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, ResourceIdentifier ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData) : base(adminPassword, dataBaseType, autonomousMaintenanceScheduleType, characterSet, computeCount, computeModel, cpuCoreCount, customerContacts, dataStorageSizeInTbs, dataStorageSizeInGbs, dbVersion, dbWorkload, displayName, isAutoScalingEnabled, isAutoScalingForStorageEnabled, peerDBIds, peerDBId, isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, timeDisasterRecoveryRoleChanged, remoteDisasterRecoveryConfiguration, localStandbyDB, failedDataRecoveryInSeconds, isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted, licenseModel, ncharacterSet, lifecycleDetails, provisioningState, lifecycleState, scheduledOperations, privateEndpointIP, privateEndpointLabel, ociUri, subnetId, vnetId, createdOn, maintenanceBeginOn, maintenanceEndOn, actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs, apexDetails, availableUpgradeVersions, connectionStrings, connectionUrls, dataSafeStatus, databaseEdition, autonomousDatabaseId, inMemoryAreaInGbs, nextLongTermBackupCreatedOn, longTermBackupSchedule, isPreview, localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs, openMode, operationsInsightsStatus, permissionLevel, privateEndpoint, provisionableCpus, role, serviceConsoleUri, sqlWebDeveloperUri, supportedRegionsToCloneTo, dataGuardRoleChangedOn, freeAutonomousDatabaseDeletedOn, timeLocalDataGuardEnabled, lastFailoverHappenedOn, lastRefreshHappenedOn, lastRefreshPointTimestamp, lastSwitchoverHappenedOn, freeAutonomousDatabaseStoppedOn, usedDataStorageSizeInGbs, usedDataStorageSizeInTbs, ocid, backupRetentionPeriodInDays, whitelistedIPs, serializedAdditionalRawData) { DataBaseType = dataBaseType; } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseUpdateProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseUpdateProperties.cs index 60d9cd1a9575..fd5c89a7f006 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseUpdateProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseUpdateProperties.cs @@ -63,7 +63,7 @@ public AutonomousDatabaseUpdateProperties() /// The user-friendly name for the Autonomous Database. /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. /// Indicates if auto scaling is enabled for the Autonomous Database storage. - /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. /// Specifies if the Autonomous Database requires mTLS connections. /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. @@ -125,7 +125,7 @@ internal AutonomousDatabaseUpdateProperties(string adminPassword, AutonomousMain public bool? IsAutoScalingEnabled { get; set; } /// Indicates if auto scaling is enabled for the Autonomous Database storage. public bool? IsAutoScalingForStorageEnabled { get; set; } - /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. public string PeerDBId { get; set; } /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. public bool? IsLocalDataGuardEnabled { get; set; } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.Serialization.cs new file mode 100644 index 000000000000..0a566c92b8c3 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + public partial class AzureSubscriptions : 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(AzureSubscriptions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("azureSubscriptionIds"u8); + writer.WriteStartArray(); + foreach (var item in AzureSubscriptionIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureSubscriptions 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(AzureSubscriptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureSubscriptions(document.RootElement, options); + } + + internal static AzureSubscriptions DeserializeAzureSubscriptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList azureSubscriptionIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureSubscriptionIds"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + azureSubscriptionIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureSubscriptions(azureSubscriptionIds, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureSubscriptions)} does not support writing '{options.Format}' format."); + } + } + + AzureSubscriptions 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 DeserializeAzureSubscriptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureSubscriptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.cs new file mode 100644 index 000000000000..4fc171c10996 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.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 System.Linq; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Azure Subscriptions model. + public partial class AzureSubscriptions + { + /// + /// 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 . + /// Azure Subscription Ids to be updated. + /// is null. + public AzureSubscriptions(IEnumerable azureSubscriptionIds) + { + Argument.AssertNotNull(azureSubscriptionIds, nameof(azureSubscriptionIds)); + + AzureSubscriptionIds = azureSubscriptionIds.ToList(); + } + + /// Initializes a new instance of . + /// Azure Subscription Ids to be updated. + /// Keeps track of any properties unknown to the library. + internal AzureSubscriptions(IList azureSubscriptionIds, IDictionary serializedAdditionalRawData) + { + AzureSubscriptionIds = azureSubscriptionIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureSubscriptions() + { + } + + /// Azure Subscription Ids to be updated. + public IList AzureSubscriptionIds { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructurePatch.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructurePatch.cs index 41954decd0b7..42364e92eec8 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructurePatch.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructurePatch.cs @@ -55,7 +55,7 @@ public CloudExadataInfrastructurePatch() /// Initializes a new instance of . /// CloudExadataInfrastructure zones. /// Resource tags. - /// The updatable properties of the CloudExadataInfrastructure. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. internal CloudExadataInfrastructurePatch(IList zones, IDictionary tags, CloudExadataInfrastructureUpdateProperties properties, IDictionary serializedAdditionalRawData) { @@ -69,7 +69,7 @@ internal CloudExadataInfrastructurePatch(IList zones, IDictionary Zones { get; } /// Resource tags. public IDictionary Tags { get; } - /// The updatable properties of the CloudExadataInfrastructure. + /// The resource-specific properties for this resource. public CloudExadataInfrastructureUpdateProperties Properties { get; set; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.Serialization.cs index f8bda17d137a..ab8fe4e3828f 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.Serialization.cs @@ -34,6 +34,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(CloudExadataInfrastructureProperties)} does not support writing '{format}' format."); } + if (options.Format != "W" && Optional.IsCollectionDefined(DefinedFileSystemConfiguration)) + { + writer.WritePropertyName("definedFileSystemConfiguration"u8); + writer.WriteStartArray(); + foreach (var item in DefinedFileSystemConfiguration) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (options.Format != "W" && Optional.IsDefined(Ocid)) { writer.WritePropertyName("ocid"u8); @@ -188,6 +198,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("monthlyStorageServerVersion"u8); writer.WriteStringValue(MonthlyStorageServerVersion); } + if (Optional.IsDefined(DatabaseServerType)) + { + writer.WritePropertyName("databaseServerType"u8); + writer.WriteStringValue(DatabaseServerType); + } + if (Optional.IsDefined(StorageServerType)) + { + writer.WritePropertyName("storageServerType"u8); + writer.WriteStringValue(StorageServerType); + } + if (options.Format != "W" && Optional.IsDefined(ComputeModel)) + { + writer.WritePropertyName("computeModel"u8); + writer.WriteStringValue(ComputeModel.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -225,6 +250,7 @@ internal static CloudExadataInfrastructureProperties DeserializeCloudExadataInfr { return null; } + IReadOnlyList definedFileSystemConfiguration = default; ResourceIdentifier ocid = default; int? computeCount = default; int? storageCount = default; @@ -256,10 +282,27 @@ internal static CloudExadataInfrastructureProperties DeserializeCloudExadataInfr ResourceIdentifier nextMaintenanceRunId = default; string monthlyDBServerVersion = default; string monthlyStorageServerVersion = default; + string databaseServerType = default; + string storageServerType = default; + AutonomousDatabaseComputeModel? computeModel = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("definedFileSystemConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.DefinedFileSystemConfiguration.DeserializeDefinedFileSystemConfiguration(item, options)); + } + definedFileSystemConfiguration = array; + continue; + } if (property.NameEquals("ocid"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -516,6 +559,25 @@ internal static CloudExadataInfrastructureProperties DeserializeCloudExadataInfr monthlyStorageServerVersion = property.Value.GetString(); continue; } + if (property.NameEquals("databaseServerType"u8)) + { + databaseServerType = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageServerType"u8)) + { + storageServerType = property.Value.GetString(); + continue; + } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new AutonomousDatabaseComputeModel(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -523,6 +585,7 @@ internal static CloudExadataInfrastructureProperties DeserializeCloudExadataInfr } serializedAdditionalRawData = rawDataDictionary; return new CloudExadataInfrastructureProperties( + definedFileSystemConfiguration ?? new ChangeTrackingList(), ocid, computeCount, storageCount, @@ -554,6 +617,9 @@ internal static CloudExadataInfrastructureProperties DeserializeCloudExadataInfr nextMaintenanceRunId, monthlyDBServerVersion, monthlyStorageServerVersion, + databaseServerType, + storageServerType, + computeModel, serializedAdditionalRawData); } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.cs index 25efe8483fb4..51d32be2a1be 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.cs @@ -55,12 +55,14 @@ public CloudExadataInfrastructureProperties(string shape, string displayName) Argument.AssertNotNull(shape, nameof(shape)); Argument.AssertNotNull(displayName, nameof(displayName)); + DefinedFileSystemConfiguration = new ChangeTrackingList(); CustomerContacts = new ChangeTrackingList(); Shape = shape; DisplayName = displayName; } /// Initializes a new instance of . + /// Defined file system configurations. /// Exadata infra ocid. /// The number of compute servers for the cloud Exadata infrastructure. /// The number of storage servers for the cloud Exadata infrastructure. @@ -92,9 +94,13 @@ public CloudExadataInfrastructureProperties(string shape, string displayName) /// The OCID of the next maintenance run. /// Monthly Db Server version. /// Monthly Storage Server version. + /// The database server model type of the cloud Exadata infrastructure resource. + /// The storage server model type of the cloud Exadata infrastructure resource. + /// The compute model of the Exadata Infrastructure. /// Keeps track of any properties unknown to the library. - internal CloudExadataInfrastructureProperties(ResourceIdentifier ocid, int? computeCount, int? storageCount, int? totalStorageSizeInGbs, int? availableStorageSizeInGbs, DateTimeOffset? createdOn, string lifecycleDetails, OracleDatabaseMaintenanceWindow maintenanceWindow, EstimatedPatchingTime estimatedPatchingTime, IList customerContacts, OracleDatabaseProvisioningState? provisioningState, CloudExadataInfrastructureLifecycleState? lifecycleState, string shape, Uri ociUri, int? cpuCount, int? maxCpuCount, int? memorySizeInGbs, int? maxMemoryInGbs, int? dbNodeStorageSizeInGbs, int? maxDBNodeStorageSizeInGbs, double? dataStorageSizeInTbs, double? maxDataStorageInTbs, string dbServerVersion, string storageServerVersion, int? activatedStorageCount, int? additionalStorageCount, string displayName, ResourceIdentifier lastMaintenanceRunId, ResourceIdentifier nextMaintenanceRunId, string monthlyDBServerVersion, string monthlyStorageServerVersion, IDictionary serializedAdditionalRawData) + internal CloudExadataInfrastructureProperties(IReadOnlyList definedFileSystemConfiguration, ResourceIdentifier ocid, int? computeCount, int? storageCount, int? totalStorageSizeInGbs, int? availableStorageSizeInGbs, DateTimeOffset? createdOn, string lifecycleDetails, OracleDatabaseMaintenanceWindow maintenanceWindow, EstimatedPatchingTime estimatedPatchingTime, IList customerContacts, OracleDatabaseProvisioningState? provisioningState, CloudExadataInfrastructureLifecycleState? lifecycleState, string shape, Uri ociUri, int? cpuCount, int? maxCpuCount, int? memorySizeInGbs, int? maxMemoryInGbs, int? dbNodeStorageSizeInGbs, int? maxDBNodeStorageSizeInGbs, double? dataStorageSizeInTbs, double? maxDataStorageInTbs, string dbServerVersion, string storageServerVersion, int? activatedStorageCount, int? additionalStorageCount, string displayName, ResourceIdentifier lastMaintenanceRunId, ResourceIdentifier nextMaintenanceRunId, string monthlyDBServerVersion, string monthlyStorageServerVersion, string databaseServerType, string storageServerType, AutonomousDatabaseComputeModel? computeModel, IDictionary serializedAdditionalRawData) { + DefinedFileSystemConfiguration = definedFileSystemConfiguration; Ocid = ocid; ComputeCount = computeCount; StorageCount = storageCount; @@ -126,6 +132,9 @@ internal CloudExadataInfrastructureProperties(ResourceIdentifier ocid, int? comp NextMaintenanceRunId = nextMaintenanceRunId; MonthlyDBServerVersion = monthlyDBServerVersion; MonthlyStorageServerVersion = monthlyStorageServerVersion; + DatabaseServerType = databaseServerType; + StorageServerType = storageServerType; + ComputeModel = computeModel; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -134,6 +143,8 @@ internal CloudExadataInfrastructureProperties() { } + /// Defined file system configurations. + public IReadOnlyList DefinedFileSystemConfiguration { get; } /// Exadata infra ocid. public ResourceIdentifier Ocid { get; } /// The number of compute servers for the cloud Exadata infrastructure. @@ -196,5 +207,11 @@ internal CloudExadataInfrastructureProperties() public string MonthlyDBServerVersion { get; } /// Monthly Storage Server version. public string MonthlyStorageServerVersion { get; } + /// The database server model type of the cloud Exadata infrastructure resource. + public string DatabaseServerType { get; set; } + /// The storage server model type of the cloud Exadata infrastructure resource. + public string StorageServerType { get; set; } + /// The compute model of the Exadata Infrastructure. + public AutonomousDatabaseComputeModel? ComputeModel { get; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterDBNodeProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterDBNodeProperties.Serialization.cs index bc31d8d98acb..a1b74f7f64e7 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterDBNodeProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterDBNodeProperties.Serialization.cs @@ -34,116 +34,101 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(CloudVmClusterDBNodeProperties)} does not support writing '{format}' format."); } - if (options.Format != "W") - { - writer.WritePropertyName("ocid"u8); - writer.WriteStringValue(Ocid); - } - if (options.Format != "W" && Optional.IsDefined(AdditionalDetails)) + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + if (Optional.IsDefined(AdditionalDetails)) { writer.WritePropertyName("additionalDetails"u8); writer.WriteStringValue(AdditionalDetails); } - if (options.Format != "W" && Optional.IsDefined(BackupIPId)) + if (Optional.IsDefined(BackupIPId)) { writer.WritePropertyName("backupIpId"u8); writer.WriteStringValue(BackupIPId); } - if (options.Format != "W" && Optional.IsDefined(BackupVnic2Id)) + if (Optional.IsDefined(BackupVnic2Id)) { writer.WritePropertyName("backupVnic2Id"u8); writer.WriteStringValue(BackupVnic2Id); } - if (options.Format != "W" && Optional.IsDefined(BackupVnicId)) + if (Optional.IsDefined(BackupVnicId)) { writer.WritePropertyName("backupVnicId"u8); writer.WriteStringValue(BackupVnicId); } - if (options.Format != "W" && Optional.IsDefined(CpuCoreCount)) + if (Optional.IsDefined(CpuCoreCount)) { writer.WritePropertyName("cpuCoreCount"u8); writer.WriteNumberValue(CpuCoreCount.Value); } - if (options.Format != "W" && Optional.IsDefined(DBNodeStorageSizeInGbs)) + if (Optional.IsDefined(DBNodeStorageSizeInGbs)) { writer.WritePropertyName("dbNodeStorageSizeInGbs"u8); writer.WriteNumberValue(DBNodeStorageSizeInGbs.Value); } - if (options.Format != "W" && Optional.IsDefined(DBServerId)) + if (Optional.IsDefined(DBServerId)) { writer.WritePropertyName("dbServerId"u8); writer.WriteStringValue(DBServerId); } - if (options.Format != "W") - { - writer.WritePropertyName("dbSystemId"u8); - writer.WriteStringValue(DBSystemId); - } - if (options.Format != "W" && Optional.IsDefined(FaultDomain)) + writer.WritePropertyName("dbSystemId"u8); + writer.WriteStringValue(DBSystemId); + if (Optional.IsDefined(FaultDomain)) { writer.WritePropertyName("faultDomain"u8); writer.WriteStringValue(FaultDomain); } - if (options.Format != "W" && Optional.IsDefined(HostIPId)) + if (Optional.IsDefined(HostIPId)) { writer.WritePropertyName("hostIpId"u8); writer.WriteStringValue(HostIPId); } - if (options.Format != "W" && Optional.IsDefined(Hostname)) + if (Optional.IsDefined(Hostname)) { writer.WritePropertyName("hostname"u8); writer.WriteStringValue(Hostname); } - if (options.Format != "W" && Optional.IsDefined(LifecycleState)) - { - writer.WritePropertyName("lifecycleState"u8); - writer.WriteStringValue(LifecycleState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(LifecycleDetails)) + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.ToString()); + if (Optional.IsDefined(LifecycleDetails)) { writer.WritePropertyName("lifecycleDetails"u8); writer.WriteStringValue(LifecycleDetails); } - if (options.Format != "W" && Optional.IsDefined(MaintenanceType)) + if (Optional.IsDefined(MaintenanceType)) { writer.WritePropertyName("maintenanceType"u8); writer.WriteStringValue(MaintenanceType.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(MemorySizeInGbs)) + if (Optional.IsDefined(MemorySizeInGbs)) { writer.WritePropertyName("memorySizeInGbs"u8); writer.WriteNumberValue(MemorySizeInGbs.Value); } - if (options.Format != "W" && Optional.IsDefined(SoftwareStorageSizeInGb)) + if (Optional.IsDefined(SoftwareStorageSizeInGb)) { writer.WritePropertyName("softwareStorageSizeInGb"u8); writer.WriteNumberValue(SoftwareStorageSizeInGb.Value); } - if (options.Format != "W" && Optional.IsDefined(TimeCreated)) - { - writer.WritePropertyName("timeCreated"u8); - writer.WriteStringValue(TimeCreated.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(TimeMaintenanceWindowEnd)) + writer.WritePropertyName("timeCreated"u8); + writer.WriteStringValue(TimeCreated, "O"); + if (Optional.IsDefined(TimeMaintenanceWindowEnd)) { writer.WritePropertyName("timeMaintenanceWindowEnd"u8); writer.WriteStringValue(TimeMaintenanceWindowEnd.Value, "O"); } - if (options.Format != "W" && Optional.IsDefined(TimeMaintenanceWindowStart)) + if (Optional.IsDefined(TimeMaintenanceWindowStart)) { writer.WritePropertyName("timeMaintenanceWindowStart"u8); writer.WriteStringValue(TimeMaintenanceWindowStart.Value, "O"); } - if (options.Format != "W" && Optional.IsDefined(Vnic2Id)) + if (Optional.IsDefined(Vnic2Id)) { writer.WritePropertyName("vnic2Id"u8); writer.WriteStringValue(Vnic2Id); } - if (options.Format != "W" && Optional.IsDefined(VnicId)) - { - writer.WritePropertyName("vnicId"u8); - writer.WriteStringValue(VnicId); - } + writer.WritePropertyName("vnicId"u8); + writer.WriteStringValue(VnicId); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -198,12 +183,12 @@ internal static CloudVmClusterDBNodeProperties DeserializeCloudVmClusterDBNodePr string faultDomain = default; ResourceIdentifier hostIPId = default; string hostname = default; - DBNodeProvisioningState? lifecycleState = default; + DBNodeProvisioningState lifecycleState = default; string lifecycleDetails = default; DBNodeMaintenanceType? maintenanceType = default; int? memorySizeInGbs = default; int? softwareStorageSizeInGb = default; - DateTimeOffset? timeCreated = default; + DateTimeOffset timeCreated = default; DateTimeOffset? timeMaintenanceWindowEnd = default; DateTimeOffset? timeMaintenanceWindowStart = default; ResourceIdentifier vnic2Id = default; @@ -303,10 +288,6 @@ internal static CloudVmClusterDBNodeProperties DeserializeCloudVmClusterDBNodePr } if (property.NameEquals("lifecycleState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } lifecycleState = new DBNodeProvisioningState(property.Value.GetString()); continue; } @@ -344,10 +325,6 @@ internal static CloudVmClusterDBNodeProperties DeserializeCloudVmClusterDBNodePr } if (property.NameEquals("timeCreated"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } timeCreated = property.Value.GetDateTimeOffset("O"); continue; } @@ -380,10 +357,6 @@ internal static CloudVmClusterDBNodeProperties DeserializeCloudVmClusterDBNodePr } if (property.NameEquals("vnicId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } vnicId = new ResourceIdentifier(property.Value.GetString()); continue; } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterDBNodeProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterDBNodeProperties.cs index b4c580563281..047f562672bb 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterDBNodeProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterDBNodeProperties.cs @@ -49,10 +49,21 @@ public partial class CloudVmClusterDBNodeProperties /// Initializes a new instance of . /// DbNode OCID. /// The OCID of the DB system. - public CloudVmClusterDBNodeProperties(ResourceIdentifier ocid, ResourceIdentifier dbSystemId) + /// The current state of the database node. + /// The date and time that the database node was created. + /// The OCID of the VNIC. + /// , or is null. + public CloudVmClusterDBNodeProperties(ResourceIdentifier ocid, ResourceIdentifier dbSystemId, DBNodeProvisioningState lifecycleState, DateTimeOffset timeCreated, ResourceIdentifier vnicId) { + Argument.AssertNotNull(ocid, nameof(ocid)); + Argument.AssertNotNull(dbSystemId, nameof(dbSystemId)); + Argument.AssertNotNull(vnicId, nameof(vnicId)); + Ocid = ocid; DBSystemId = dbSystemId; + LifecycleState = lifecycleState; + TimeCreated = timeCreated; + VnicId = vnicId; } /// Initializes a new instance of . @@ -80,7 +91,7 @@ public CloudVmClusterDBNodeProperties(ResourceIdentifier ocid, ResourceIdentifie /// The OCID of the VNIC. /// Azure resource provisioning state. /// Keeps track of any properties unknown to the library. - internal CloudVmClusterDBNodeProperties(ResourceIdentifier ocid, string additionalDetails, ResourceIdentifier backupIPId, ResourceIdentifier backupVnic2Id, ResourceIdentifier backupVnicId, int? cpuCoreCount, int? dbNodeStorageSizeInGbs, ResourceIdentifier dbServerId, ResourceIdentifier dbSystemId, string faultDomain, ResourceIdentifier hostIPId, string hostname, DBNodeProvisioningState? lifecycleState, string lifecycleDetails, DBNodeMaintenanceType? maintenanceType, int? memorySizeInGbs, int? softwareStorageSizeInGb, DateTimeOffset? timeCreated, DateTimeOffset? timeMaintenanceWindowEnd, DateTimeOffset? timeMaintenanceWindowStart, ResourceIdentifier vnic2Id, ResourceIdentifier vnicId, OracleDatabaseResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + internal CloudVmClusterDBNodeProperties(ResourceIdentifier ocid, string additionalDetails, ResourceIdentifier backupIPId, ResourceIdentifier backupVnic2Id, ResourceIdentifier backupVnicId, int? cpuCoreCount, int? dbNodeStorageSizeInGbs, ResourceIdentifier dbServerId, ResourceIdentifier dbSystemId, string faultDomain, ResourceIdentifier hostIPId, string hostname, DBNodeProvisioningState lifecycleState, string lifecycleDetails, DBNodeMaintenanceType? maintenanceType, int? memorySizeInGbs, int? softwareStorageSizeInGb, DateTimeOffset timeCreated, DateTimeOffset? timeMaintenanceWindowEnd, DateTimeOffset? timeMaintenanceWindowStart, ResourceIdentifier vnic2Id, ResourceIdentifier vnicId, OracleDatabaseResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) { Ocid = ocid; AdditionalDetails = additionalDetails; @@ -114,49 +125,49 @@ internal CloudVmClusterDBNodeProperties() } /// DbNode OCID. - public ResourceIdentifier Ocid { get; } + public ResourceIdentifier Ocid { get; set; } /// Additional information about the planned maintenance. - public string AdditionalDetails { get; } + public string AdditionalDetails { get; set; } /// The OCID of the backup IP address associated with the database node. - public ResourceIdentifier BackupIPId { get; } + public ResourceIdentifier BackupIPId { get; set; } /// The OCID of the second backup VNIC. - public ResourceIdentifier BackupVnic2Id { get; } + public ResourceIdentifier BackupVnic2Id { get; set; } /// The OCID of the backup VNIC. - public ResourceIdentifier BackupVnicId { get; } + public ResourceIdentifier BackupVnicId { get; set; } /// The number of CPU cores enabled on the Db node. - public int? CpuCoreCount { get; } + public int? CpuCoreCount { get; set; } /// The allocated local node storage in GBs on the Db node. - public int? DBNodeStorageSizeInGbs { get; } + public int? DBNodeStorageSizeInGbs { get; set; } /// The OCID of the Exacc Db server associated with the database node. - public ResourceIdentifier DBServerId { get; } + public ResourceIdentifier DBServerId { get; set; } /// The OCID of the DB system. - public ResourceIdentifier DBSystemId { get; } + public ResourceIdentifier DBSystemId { get; set; } /// The name of the Fault Domain the instance is contained in. - public string FaultDomain { get; } + public string FaultDomain { get; set; } /// The OCID of the host IP address associated with the database node. - public ResourceIdentifier HostIPId { get; } + public ResourceIdentifier HostIPId { get; set; } /// The host name for the database node. - public string Hostname { get; } + public string Hostname { get; set; } /// The current state of the database node. - public DBNodeProvisioningState? LifecycleState { get; } + public DBNodeProvisioningState LifecycleState { get; set; } /// Lifecycle details of Db Node. - public string LifecycleDetails { get; } + public string LifecycleDetails { get; set; } /// The type of database node maintenance. - public DBNodeMaintenanceType? MaintenanceType { get; } + public DBNodeMaintenanceType? MaintenanceType { get; set; } /// The allocated memory in GBs on the Db node. - public int? MemorySizeInGbs { get; } + public int? MemorySizeInGbs { get; set; } /// The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine DB systems. - public int? SoftwareStorageSizeInGb { get; } + public int? SoftwareStorageSizeInGb { get; set; } /// The date and time that the database node was created. - public DateTimeOffset? TimeCreated { get; } + public DateTimeOffset TimeCreated { get; set; } /// End date and time of maintenance window. - public DateTimeOffset? TimeMaintenanceWindowEnd { get; } + public DateTimeOffset? TimeMaintenanceWindowEnd { get; set; } /// Start date and time of maintenance window. - public DateTimeOffset? TimeMaintenanceWindowStart { get; } + public DateTimeOffset? TimeMaintenanceWindowStart { get; set; } /// The OCID of the second VNIC. - public ResourceIdentifier Vnic2Id { get; } + public ResourceIdentifier Vnic2Id { get; set; } /// The OCID of the VNIC. - public ResourceIdentifier VnicId { get; } + public ResourceIdentifier VnicId { get; set; } /// Azure resource provisioning state. public OracleDatabaseResourceProvisioningState? ProvisioningState { get; } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterPatch.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterPatch.cs index 32879c816a6a..67473a1a7c53 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterPatch.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterPatch.cs @@ -53,7 +53,7 @@ public CloudVmClusterPatch() /// Initializes a new instance of . /// Resource tags. - /// The updatable properties of the CloudVmCluster. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. internal CloudVmClusterPatch(IDictionary tags, CloudVmClusterUpdateProperties properties, IDictionary serializedAdditionalRawData) { @@ -64,7 +64,7 @@ internal CloudVmClusterPatch(IDictionary tags, CloudVmClusterUpd /// Resource tags. public IDictionary Tags { get; } - /// The updatable properties of the CloudVmCluster. + /// The resource-specific properties for this resource. public CloudVmClusterUpdateProperties Properties { get; set; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.Serialization.cs index 333ac94297f0..c324ebdfced3 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.Serialization.cs @@ -54,6 +54,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("storageSizeInGbs"u8); writer.WriteNumberValue(StorageSizeInGbs.Value); } + if (Optional.IsCollectionDefined(FileSystemConfigurationDetails)) + { + writer.WritePropertyName("fileSystemConfigurationDetails"u8); + writer.WriteStartArray(); + foreach (var item in FileSystemConfigurationDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(DataStorageSizeInTbs)) { writer.WritePropertyName("dataStorageSizeInTbs"u8); @@ -290,6 +300,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("subnetOcid"u8); writer.WriteStringValue(SubnetOcid); } + if (options.Format != "W" && Optional.IsDefined(ComputeModel)) + { + writer.WritePropertyName("computeModel"u8); + writer.WriteStringValue(ComputeModel.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -331,6 +346,7 @@ internal static CloudVmClusterProperties DeserializeCloudVmClusterProperties(Jso long? listenerPort = default; int? nodeCount = default; int? storageSizeInGbs = default; + IList fileSystemConfigurationDetails = default; double? dataStorageSizeInTbs = default; int? dbNodeStorageSizeInGbs = default; int? memorySizeInGbs = default; @@ -375,6 +391,7 @@ internal static CloudVmClusterProperties DeserializeCloudVmClusterProperties(Jso IList dbServers = default; ResourceIdentifier compartmentId = default; ResourceIdentifier subnetOcid = default; + AutonomousDatabaseComputeModel? computeModel = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -415,6 +432,20 @@ internal static CloudVmClusterProperties DeserializeCloudVmClusterProperties(Jso storageSizeInGbs = property.Value.GetInt32(); continue; } + if (property.NameEquals("fileSystemConfigurationDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.FileSystemConfigurationDetails.DeserializeFileSystemConfigurationDetails(item, options)); + } + fileSystemConfigurationDetails = array; + continue; + } if (property.NameEquals("dataStorageSizeInTbs"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -791,6 +822,15 @@ internal static CloudVmClusterProperties DeserializeCloudVmClusterProperties(Jso subnetOcid = new ResourceIdentifier(property.Value.GetString()); continue; } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new AutonomousDatabaseComputeModel(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -802,6 +842,7 @@ internal static CloudVmClusterProperties DeserializeCloudVmClusterProperties(Jso listenerPort, nodeCount, storageSizeInGbs, + fileSystemConfigurationDetails ?? new ChangeTrackingList(), dataStorageSizeInTbs, dbNodeStorageSizeInGbs, memorySizeInGbs, @@ -846,6 +887,7 @@ internal static CloudVmClusterProperties DeserializeCloudVmClusterProperties(Jso dbServers ?? new ChangeTrackingList(), compartmentId, subnetOcid, + computeModel, serializedAdditionalRawData); } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.cs index e4d48c3dafc5..e628a6c3ac2d 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.cs @@ -67,6 +67,7 @@ public CloudVmClusterProperties(string hostname, int cpuCoreCount, ResourceIdent Argument.AssertNotNull(subnetId, nameof(subnetId)); Argument.AssertNotNull(displayName, nameof(displayName)); + FileSystemConfigurationDetails = new ChangeTrackingList(); Hostname = hostname; CpuCoreCount = cpuCoreCount; CloudExadataInfrastructureId = cloudExadataInfrastructureId; @@ -87,6 +88,7 @@ public CloudVmClusterProperties(string hostname, int cpuCoreCount, ResourceIdent /// The port number configured for the listener on the cloud VM cluster. /// The number of nodes in the cloud VM cluster. /// The data disk group size to be allocated in GBs per VM. + /// Array of mount path and size. /// The data disk group size to be allocated in TBs. /// The local node storage to be allocated in GBs. /// The memory to be allocated in GBs. @@ -131,13 +133,15 @@ public CloudVmClusterProperties(string hostname, int cpuCoreCount, ResourceIdent /// The list of DB servers. /// Cluster compartmentId. /// Cluster subnet ocid. + /// The compute model of the VM Cluster. /// Keeps track of any properties unknown to the library. - internal CloudVmClusterProperties(ResourceIdentifier ocid, long? listenerPort, int? nodeCount, int? storageSizeInGbs, double? dataStorageSizeInTbs, int? dbNodeStorageSizeInGbs, int? memorySizeInGbs, DateTimeOffset? createdOn, string lifecycleDetails, string timeZone, ResourceIdentifier zoneId, string hostname, string domain, int cpuCoreCount, float? ocpuCount, string clusterName, int? dataStoragePercentage, bool? isLocalBackupEnabled, ResourceIdentifier cloudExadataInfrastructureId, bool? isSparseDiskgroupEnabled, string systemVersion, IList sshPublicKeys, OracleLicenseModel? licenseModel, CloudVmClusterDiskRedundancy? diskRedundancy, IReadOnlyList scanIPIds, IReadOnlyList vipIds, string scanDnsName, int? scanListenerPortTcp, int? scanListenerPortTcpSsl, ResourceIdentifier scanDnsRecordId, string shape, OracleDatabaseProvisioningState? provisioningState, CloudVmClusterLifecycleState? lifecycleState, ResourceIdentifier vnetId, string giVersion, Uri ociUri, Uri nsgUri, ResourceIdentifier subnetId, string backupSubnetCidr, IList nsgCidrs, DiagnosticCollectionConfig dataCollectionOptions, string displayName, IList computeNodes, ExadataIormConfig iormConfigCache, ResourceIdentifier lastUpdateHistoryEntryId, IList dbServers, ResourceIdentifier compartmentId, ResourceIdentifier subnetOcid, IDictionary serializedAdditionalRawData) + internal CloudVmClusterProperties(ResourceIdentifier ocid, long? listenerPort, int? nodeCount, int? storageSizeInGbs, IList fileSystemConfigurationDetails, double? dataStorageSizeInTbs, int? dbNodeStorageSizeInGbs, int? memorySizeInGbs, DateTimeOffset? createdOn, string lifecycleDetails, string timeZone, ResourceIdentifier zoneId, string hostname, string domain, int cpuCoreCount, float? ocpuCount, string clusterName, int? dataStoragePercentage, bool? isLocalBackupEnabled, ResourceIdentifier cloudExadataInfrastructureId, bool? isSparseDiskgroupEnabled, string systemVersion, IList sshPublicKeys, OracleLicenseModel? licenseModel, CloudVmClusterDiskRedundancy? diskRedundancy, IReadOnlyList scanIPIds, IReadOnlyList vipIds, string scanDnsName, int? scanListenerPortTcp, int? scanListenerPortTcpSsl, ResourceIdentifier scanDnsRecordId, string shape, OracleDatabaseProvisioningState? provisioningState, CloudVmClusterLifecycleState? lifecycleState, ResourceIdentifier vnetId, string giVersion, Uri ociUri, Uri nsgUri, ResourceIdentifier subnetId, string backupSubnetCidr, IList nsgCidrs, DiagnosticCollectionConfig dataCollectionOptions, string displayName, IList computeNodes, ExadataIormConfig iormConfigCache, ResourceIdentifier lastUpdateHistoryEntryId, IList dbServers, ResourceIdentifier compartmentId, ResourceIdentifier subnetOcid, AutonomousDatabaseComputeModel? computeModel, IDictionary serializedAdditionalRawData) { Ocid = ocid; ListenerPort = listenerPort; NodeCount = nodeCount; StorageSizeInGbs = storageSizeInGbs; + FileSystemConfigurationDetails = fileSystemConfigurationDetails; DataStorageSizeInTbs = dataStorageSizeInTbs; DBNodeStorageSizeInGbs = dbNodeStorageSizeInGbs; MemorySizeInGbs = memorySizeInGbs; @@ -182,6 +186,7 @@ internal CloudVmClusterProperties(ResourceIdentifier ocid, long? listenerPort, i DBServers = dbServers; CompartmentId = compartmentId; SubnetOcid = subnetOcid; + ComputeModel = computeModel; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -198,6 +203,8 @@ internal CloudVmClusterProperties() public int? NodeCount { get; } /// The data disk group size to be allocated in GBs per VM. public int? StorageSizeInGbs { get; set; } + /// Array of mount path and size. + public IList FileSystemConfigurationDetails { get; } /// The data disk group size to be allocated in TBs. public double? DataStorageSizeInTbs { get; set; } /// The local node storage to be allocated in GBs. @@ -286,5 +293,7 @@ internal CloudVmClusterProperties() public ResourceIdentifier CompartmentId { get; } /// Cluster subnet ocid. public ResourceIdentifier SubnetOcid { get; } + /// The compute model of the VM Cluster. + public AutonomousDatabaseComputeModel? ComputeModel { get; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.Serialization.cs index df622c2da0d9..1d9dc55d9334 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.Serialization.cs @@ -39,6 +39,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("storageSizeInGbs"u8); writer.WriteNumberValue(StorageSizeInGbs.Value); } + if (Optional.IsCollectionDefined(FileSystemConfigurationDetails)) + { + writer.WritePropertyName("fileSystemConfigurationDetails"u8); + writer.WriteStartArray(); + foreach (var item in FileSystemConfigurationDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(DataStorageSizeInTbs)) { writer.WritePropertyName("dataStorageSizeInTbs"u8); @@ -142,6 +152,7 @@ internal static CloudVmClusterUpdateProperties DeserializeCloudVmClusterUpdatePr return null; } int? storageSizeInGbs = default; + IList fileSystemConfigurationDetails = default; double? dataStorageSizeInTbs = default; int? dbNodeStorageSizeInGbs = default; int? memorySizeInGbs = default; @@ -165,6 +176,20 @@ internal static CloudVmClusterUpdateProperties DeserializeCloudVmClusterUpdatePr storageSizeInGbs = property.Value.GetInt32(); continue; } + if (property.NameEquals("fileSystemConfigurationDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.FileSystemConfigurationDetails.DeserializeFileSystemConfigurationDetails(item, options)); + } + fileSystemConfigurationDetails = array; + continue; + } if (property.NameEquals("dataStorageSizeInTbs"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -276,6 +301,7 @@ internal static CloudVmClusterUpdateProperties DeserializeCloudVmClusterUpdatePr serializedAdditionalRawData = rawDataDictionary; return new CloudVmClusterUpdateProperties( storageSizeInGbs, + fileSystemConfigurationDetails ?? new ChangeTrackingList(), dataStorageSizeInTbs, dbNodeStorageSizeInGbs, memorySizeInGbs, diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.cs index b4d331ff46a0..3526f7c14720 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.cs @@ -49,12 +49,14 @@ public partial class CloudVmClusterUpdateProperties /// Initializes a new instance of . public CloudVmClusterUpdateProperties() { + FileSystemConfigurationDetails = new ChangeTrackingList(); SshPublicKeys = new ChangeTrackingList(); ComputeNodes = new ChangeTrackingList(); } /// Initializes a new instance of . /// The data disk group size to be allocated in GBs per VM. + /// Array of mount path and size. /// The data disk group size to be allocated in TBs. /// The local node storage to be allocated in GBs. /// The memory to be allocated in GBs. @@ -66,9 +68,10 @@ public CloudVmClusterUpdateProperties() /// Display Name. /// The list of compute servers to be added to the cloud VM cluster. /// Keeps track of any properties unknown to the library. - internal CloudVmClusterUpdateProperties(int? storageSizeInGbs, double? dataStorageSizeInTbs, int? dbNodeStorageSizeInGbs, int? memorySizeInGbs, int? cpuCoreCount, float? ocpuCount, IList sshPublicKeys, OracleLicenseModel? licenseModel, DiagnosticCollectionConfig dataCollectionOptions, string displayName, IList computeNodes, IDictionary serializedAdditionalRawData) + internal CloudVmClusterUpdateProperties(int? storageSizeInGbs, IList fileSystemConfigurationDetails, double? dataStorageSizeInTbs, int? dbNodeStorageSizeInGbs, int? memorySizeInGbs, int? cpuCoreCount, float? ocpuCount, IList sshPublicKeys, OracleLicenseModel? licenseModel, DiagnosticCollectionConfig dataCollectionOptions, string displayName, IList computeNodes, IDictionary serializedAdditionalRawData) { StorageSizeInGbs = storageSizeInGbs; + FileSystemConfigurationDetails = fileSystemConfigurationDetails; DataStorageSizeInTbs = dataStorageSizeInTbs; DBNodeStorageSizeInGbs = dbNodeStorageSizeInGbs; MemorySizeInGbs = memorySizeInGbs; @@ -84,6 +87,8 @@ internal CloudVmClusterUpdateProperties(int? storageSizeInGbs, double? dataStora /// The data disk group size to be allocated in GBs per VM. public int? StorageSizeInGbs { get; set; } + /// Array of mount path and size. + public IList FileSystemConfigurationDetails { get; } /// The data disk group size to be allocated in TBs. public double? DataStorageSizeInTbs { get; set; } /// The local node storage to be allocated in GBs. diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBActionResponse.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBActionResponse.Serialization.cs new file mode 100644 index 000000000000..0a70f6f8d968 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBActionResponse.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.OracleDatabase.Models +{ + public partial class DBActionResponse : 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(DBActionResponse)} 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" && _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 + } + } + } + + DBActionResponse 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(DBActionResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDBActionResponse(document.RootElement, options); + } + + internal static DBActionResponse DeserializeDBActionResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OracleDatabaseProvisioningState? provisioningState = 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 OracleDatabaseProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DBActionResponse(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); + default: + throw new FormatException($"The model {nameof(DBActionResponse)} does not support writing '{options.Format}' format."); + } + } + + DBActionResponse 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 DeserializeDBActionResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DBActionResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBActionResponse.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBActionResponse.cs new file mode 100644 index 000000000000..135139f4109c --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBActionResponse.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// ExascaleDbNode action response. + public partial class DBActionResponse + { + /// + /// 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 DBActionResponse() + { + } + + /// Initializes a new instance of . + /// ExascaleDbNode provisioning state. + /// Keeps track of any properties unknown to the library. + internal DBActionResponse(OracleDatabaseProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// ExascaleDbNode provisioning state. + public OracleDatabaseProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBNodeDetails.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBNodeDetails.Serialization.cs new file mode 100644 index 000000000000..1b034161d281 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBNodeDetails.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.OracleDatabase.Models +{ + public partial class DBNodeDetails : 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(DBNodeDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("dbNodeId"u8); + writer.WriteStringValue(DBNodeId); + 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 + } + } + } + + DBNodeDetails 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(DBNodeDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDBNodeDetails(document.RootElement, options); + } + + internal static DBNodeDetails DeserializeDBNodeDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier dbNodeId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dbNodeId"u8)) + { + dbNodeId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DBNodeDetails(dbNodeId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DBNodeDetails)} does not support writing '{options.Format}' format."); + } + } + + DBNodeDetails 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 DeserializeDBNodeDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DBNodeDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBNodeDetails.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBNodeDetails.cs new file mode 100644 index 000000000000..3b76392fb9bc --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DBNodeDetails.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; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Details of the ExaCS Db node. Applies to Exadata Database Service on Exascale Infrastructure only. + public partial class DBNodeDetails + { + /// + /// 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 . + /// Exascale DbNode Azure Resource ID. + /// is null. + public DBNodeDetails(ResourceIdentifier dbNodeId) + { + Argument.AssertNotNull(dbNodeId, nameof(dbNodeId)); + + DBNodeId = dbNodeId; + } + + /// Initializes a new instance of . + /// Exascale DbNode Azure Resource ID. + /// Keeps track of any properties unknown to the library. + internal DBNodeDetails(ResourceIdentifier dbNodeId, IDictionary serializedAdditionalRawData) + { + DBNodeId = dbNodeId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DBNodeDetails() + { + } + + /// Exascale DbNode Azure Resource ID. + public ResourceIdentifier DBNodeId { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.Serialization.cs new file mode 100644 index 000000000000..b24c087704af --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + public partial class DefinedFileSystemConfiguration : 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(DefinedFileSystemConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IsBackupPartition)) + { + writer.WritePropertyName("isBackupPartition"u8); + writer.WriteBooleanValue(IsBackupPartition.Value); + } + if (Optional.IsDefined(IsResizable)) + { + writer.WritePropertyName("isResizable"u8); + writer.WriteBooleanValue(IsResizable.Value); + } + if (Optional.IsDefined(MinSizeGb)) + { + writer.WritePropertyName("minSizeGb"u8); + writer.WriteNumberValue(MinSizeGb.Value); + } + if (Optional.IsDefined(MountPoint)) + { + writer.WritePropertyName("mountPoint"u8); + writer.WriteStringValue(MountPoint); + } + 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 + } + } + } + + DefinedFileSystemConfiguration 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(DefinedFileSystemConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDefinedFileSystemConfiguration(document.RootElement, options); + } + + internal static DefinedFileSystemConfiguration DeserializeDefinedFileSystemConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? isBackupPartition = default; + bool? isResizable = default; + int? minSizeGb = default; + string mountPoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("isBackupPartition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isBackupPartition = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isResizable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isResizable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("minSizeGb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minSizeGb = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("mountPoint"u8)) + { + mountPoint = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DefinedFileSystemConfiguration(isBackupPartition, isResizable, minSizeGb, mountPoint, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DefinedFileSystemConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DefinedFileSystemConfiguration 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 DeserializeDefinedFileSystemConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DefinedFileSystemConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.cs new file mode 100644 index 000000000000..a1adfc28521a --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Predefined configurations for the file system. + public partial class DefinedFileSystemConfiguration + { + /// + /// 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 DefinedFileSystemConfiguration() + { + } + + /// Initializes a new instance of . + /// Checks if the data can be backed up. + /// Checks if the mount path is resizable. + /// Minimum size of mount path in Gb. + /// Mount path for the file system. + /// Keeps track of any properties unknown to the library. + internal DefinedFileSystemConfiguration(bool? isBackupPartition, bool? isResizable, int? minSizeGb, string mountPoint, IDictionary serializedAdditionalRawData) + { + IsBackupPartition = isBackupPartition; + IsResizable = isResizable; + MinSizeGb = minSizeGb; + MountPoint = mountPoint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Checks if the data can be backed up. + public bool? IsBackupPartition { get; } + /// Checks if the mount path is resizable. + public bool? IsResizable { get; } + /// Minimum size of mount path in Gb. + public int? MinSizeGb { get; } + /// Mount path for the file system. + public string MountPoint { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.Serialization.cs new file mode 100644 index 000000000000..7afb8644cd6c --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.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.OracleDatabase.Models +{ + public partial class DisasterRecoveryConfigurationDetails : 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(DisasterRecoveryConfigurationDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DisasterRecoveryType)) + { + writer.WritePropertyName("disasterRecoveryType"u8); + writer.WriteStringValue(DisasterRecoveryType.Value.ToString()); + } + if (Optional.IsDefined(TimeSnapshotStandbyEnabledTill)) + { + writer.WritePropertyName("timeSnapshotStandbyEnabledTill"u8); + writer.WriteStringValue(TimeSnapshotStandbyEnabledTill.Value, "O"); + } + if (Optional.IsDefined(IsSnapshotStandby)) + { + writer.WritePropertyName("isSnapshotStandby"u8); + writer.WriteBooleanValue(IsSnapshotStandby.Value); + } + if (Optional.IsDefined(IsReplicateAutomaticBackups)) + { + writer.WritePropertyName("isReplicateAutomaticBackups"u8); + writer.WriteBooleanValue(IsReplicateAutomaticBackups.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 + } + } + } + + DisasterRecoveryConfigurationDetails 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(DisasterRecoveryConfigurationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDisasterRecoveryConfigurationDetails(document.RootElement, options); + } + + internal static DisasterRecoveryConfigurationDetails DeserializeDisasterRecoveryConfigurationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DisasterRecoveryType? disasterRecoveryType = default; + DateTimeOffset? timeSnapshotStandbyEnabledTill = default; + bool? isSnapshotStandby = default; + bool? isReplicateAutomaticBackups = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("disasterRecoveryType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disasterRecoveryType = new DisasterRecoveryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeSnapshotStandbyEnabledTill"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeSnapshotStandbyEnabledTill = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("isSnapshotStandby"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSnapshotStandby = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isReplicateAutomaticBackups"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isReplicateAutomaticBackups = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DisasterRecoveryConfigurationDetails(disasterRecoveryType, timeSnapshotStandbyEnabledTill, isSnapshotStandby, isReplicateAutomaticBackups, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DisasterRecoveryConfigurationDetails)} does not support writing '{options.Format}' format."); + } + } + + DisasterRecoveryConfigurationDetails 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 DeserializeDisasterRecoveryConfigurationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DisasterRecoveryConfigurationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.cs new file mode 100644 index 000000000000..c018dac97a20 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Configurations of a Disaster Recovery Details. + public partial class DisasterRecoveryConfigurationDetails + { + /// + /// 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 DisasterRecoveryConfigurationDetails() + { + } + + /// Initializes a new instance of . + /// Indicates the disaster recovery (DR) type of the Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// Time and date stored as an RFC 3339 formatted timestamp string. For example, 2022-01-01T12:00:00.000Z would set a limit for the snapshot standby to be converted back to a cross-region standby database. + /// Indicates if user wants to convert to a snapshot standby. For example, true would set a standby database to snapshot standby database. False would set a snapshot standby database back to regular standby database. + /// If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the backups taken on the Primary are not replicated to the Standby database. + /// Keeps track of any properties unknown to the library. + internal DisasterRecoveryConfigurationDetails(DisasterRecoveryType? disasterRecoveryType, DateTimeOffset? timeSnapshotStandbyEnabledTill, bool? isSnapshotStandby, bool? isReplicateAutomaticBackups, IDictionary serializedAdditionalRawData) + { + DisasterRecoveryType = disasterRecoveryType; + TimeSnapshotStandbyEnabledTill = timeSnapshotStandbyEnabledTill; + IsSnapshotStandby = isSnapshotStandby; + IsReplicateAutomaticBackups = isReplicateAutomaticBackups; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates the disaster recovery (DR) type of the Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + public DisasterRecoveryType? DisasterRecoveryType { get; set; } + /// Time and date stored as an RFC 3339 formatted timestamp string. For example, 2022-01-01T12:00:00.000Z would set a limit for the snapshot standby to be converted back to a cross-region standby database. + public DateTimeOffset? TimeSnapshotStandbyEnabledTill { get; set; } + /// Indicates if user wants to convert to a snapshot standby. For example, true would set a standby database to snapshot standby database. False would set a snapshot standby database back to regular standby database. + public bool? IsSnapshotStandby { get; set; } + /// If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the backups taken on the Primary are not replicated to the Standby database. + public bool? IsReplicateAutomaticBackups { get; set; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterLifecycleState.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterLifecycleState.cs new file mode 100644 index 000000000000..e8ea2cb028ed --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterLifecycleState.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.OracleDatabase.Models +{ + /// Exadata VM cluster on Exascale Infrastructure lifecycle state enum. + public readonly partial struct ExadbVmClusterLifecycleState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ExadbVmClusterLifecycleState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProvisioningValue = "Provisioning"; + private const string AvailableValue = "Available"; + private const string UpdatingValue = "Updating"; + private const string TerminatingValue = "Terminating"; + private const string TerminatedValue = "Terminated"; + private const string MaintenanceInProgressValue = "MaintenanceInProgress"; + private const string FailedValue = "Failed"; + + /// Indicates that resource in Provisioning state. + public static ExadbVmClusterLifecycleState Provisioning { get; } = new ExadbVmClusterLifecycleState(ProvisioningValue); + /// Indicates that resource in Available state. + public static ExadbVmClusterLifecycleState Available { get; } = new ExadbVmClusterLifecycleState(AvailableValue); + /// Indicates that resource in Updating state. + public static ExadbVmClusterLifecycleState Updating { get; } = new ExadbVmClusterLifecycleState(UpdatingValue); + /// Indicates that resource in Terminating state. + public static ExadbVmClusterLifecycleState Terminating { get; } = new ExadbVmClusterLifecycleState(TerminatingValue); + /// Indicates that resource in Terminated state. + public static ExadbVmClusterLifecycleState Terminated { get; } = new ExadbVmClusterLifecycleState(TerminatedValue); + /// Indicates that resource Maintenance in progress state. + public static ExadbVmClusterLifecycleState MaintenanceInProgress { get; } = new ExadbVmClusterLifecycleState(MaintenanceInProgressValue); + /// Indicates that resource in Failed state. + public static ExadbVmClusterLifecycleState Failed { get; } = new ExadbVmClusterLifecycleState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(ExadbVmClusterLifecycleState left, ExadbVmClusterLifecycleState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ExadbVmClusterLifecycleState left, ExadbVmClusterLifecycleState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ExadbVmClusterLifecycleState(string value) => new ExadbVmClusterLifecycleState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ExadbVmClusterLifecycleState other && Equals(other); + /// + public bool Equals(ExadbVmClusterLifecycleState 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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.Serialization.cs new file mode 100644 index 000000000000..9a7fd7cd393d --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.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.OracleDatabase.Models +{ + internal partial class ExadbVmClusterListResult : 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(ExadbVmClusterListResult)} 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 + } + } + } + + ExadbVmClusterListResult 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(ExadbVmClusterListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExadbVmClusterListResult(document.RootElement, options); + } + + internal static ExadbVmClusterListResult DeserializeExadbVmClusterListResult(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(ExadbVmClusterData.DeserializeExadbVmClusterData(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 ExadbVmClusterListResult(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); + default: + throw new FormatException($"The model {nameof(ExadbVmClusterListResult)} does not support writing '{options.Format}' format."); + } + } + + ExadbVmClusterListResult 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 DeserializeExadbVmClusterListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExadbVmClusterListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.cs new file mode 100644 index 000000000000..0b76d8b494a5 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.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.OracleDatabase.Models +{ + /// The response of a ExadbVmCluster list operation. + internal partial class ExadbVmClusterListResult + { + /// + /// 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 ExadbVmCluster items on this page. + /// is null. + internal ExadbVmClusterListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ExadbVmCluster items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ExadbVmClusterListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExadbVmClusterListResult() + { + } + + /// The ExadbVmCluster items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.Serialization.cs new file mode 100644 index 000000000000..7d4c2ebd7bd6 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.Serialization.cs @@ -0,0 +1,184 @@ +// 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.OracleDatabase.Models +{ + public partial class ExadbVmClusterPatch : 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(ExadbVmClusterPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Zones)) + { + writer.WritePropertyName("zones"u8); + writer.WriteStartArray(); + foreach (var item in Zones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + 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 (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 + } + } + } + + ExadbVmClusterPatch 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(ExadbVmClusterPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExadbVmClusterPatch(document.RootElement, options); + } + + internal static ExadbVmClusterPatch DeserializeExadbVmClusterPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList zones = default; + IDictionary tags = default; + ExadbVmClusterUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("zones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; + 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("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ExadbVmClusterUpdateProperties.DeserializeExadbVmClusterUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExadbVmClusterPatch(zones ?? new ChangeTrackingList(), 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); + default: + throw new FormatException($"The model {nameof(ExadbVmClusterPatch)} does not support writing '{options.Format}' format."); + } + } + + ExadbVmClusterPatch 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 DeserializeExadbVmClusterPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExadbVmClusterPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.cs new file mode 100644 index 000000000000..7519852ffaf6 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.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.OracleDatabase.Models +{ + /// The type used for update operations of the ExadbVmCluster. + public partial class ExadbVmClusterPatch + { + /// + /// 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 ExadbVmClusterPatch() + { + Zones = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The availability zones. + /// Resource tags. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal ExadbVmClusterPatch(IList zones, IDictionary tags, ExadbVmClusterUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Zones = zones; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The availability zones. + public IList Zones { get; } + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + internal ExadbVmClusterUpdateProperties Properties { get; set; } + /// The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + public int? ExadbVmClusterUpdateNodeCount + { + get => Properties is null ? default : Properties.NodeCount; + set + { + if (Properties is null) + Properties = new ExadbVmClusterUpdateProperties(); + Properties.NodeCount = value; + } + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.Serialization.cs new file mode 100644 index 000000000000..0c04583a9f30 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.Serialization.cs @@ -0,0 +1,738 @@ +// 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.OracleDatabase.Models +{ + public partial class ExadbVmClusterProperties : 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(ExadbVmClusterProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Ocid)) + { + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + } + if (Optional.IsDefined(ClusterName)) + { + writer.WritePropertyName("clusterName"u8); + writer.WriteStringValue(ClusterName); + } + if (Optional.IsDefined(BackupSubnetCidr)) + { + writer.WritePropertyName("backupSubnetCidr"u8); + writer.WriteStringValue(BackupSubnetCidr); + } + if (options.Format != "W" && Optional.IsDefined(NsgUri)) + { + writer.WritePropertyName("nsgUrl"u8); + writer.WriteStringValue(NsgUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleState)) + { + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.Value.ToString()); + } + writer.WritePropertyName("vnetId"u8); + writer.WriteStringValue(VnetId); + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + if (Optional.IsDefined(DataCollectionOptions)) + { + writer.WritePropertyName("dataCollectionOptions"u8); + writer.WriteObjectValue(DataCollectionOptions, options); + } + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + if (Optional.IsDefined(Domain)) + { + writer.WritePropertyName("domain"u8); + writer.WriteStringValue(Domain); + } + writer.WritePropertyName("enabledEcpuCount"u8); + writer.WriteNumberValue(EnabledEcpuCount); + writer.WritePropertyName("exascaleDbStorageVaultId"u8); + writer.WriteStringValue(ExascaleDBStorageVaultId); + if (Optional.IsDefined(GridImageOcid)) + { + writer.WritePropertyName("gridImageOcid"u8); + writer.WriteStringValue(GridImageOcid); + } + if (options.Format != "W" && Optional.IsDefined(GridImageType)) + { + writer.WritePropertyName("gridImageType"u8); + writer.WriteStringValue(GridImageType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(GiVersion)) + { + writer.WritePropertyName("giVersion"u8); + writer.WriteStringValue(GiVersion); + } + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + if (Optional.IsDefined(LicenseModel)) + { + writer.WritePropertyName("licenseModel"u8); + writer.WriteStringValue(LicenseModel.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(MemorySizeInGbs)) + { + writer.WritePropertyName("memorySizeInGbs"u8); + writer.WriteNumberValue(MemorySizeInGbs.Value); + } + writer.WritePropertyName("nodeCount"u8); + writer.WriteNumberValue(NodeCount); + if (Optional.IsCollectionDefined(NsgCidrs)) + { + writer.WritePropertyName("nsgCidrs"u8); + writer.WriteStartArray(); + foreach (var item in NsgCidrs) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ZoneOcid)) + { + writer.WritePropertyName("zoneOcid"u8); + writer.WriteStringValue(ZoneOcid); + } + if (Optional.IsDefined(PrivateZoneOcid)) + { + writer.WritePropertyName("privateZoneOcid"u8); + writer.WriteStringValue(PrivateZoneOcid); + } + if (Optional.IsDefined(ScanListenerPortTcp)) + { + writer.WritePropertyName("scanListenerPortTcp"u8); + writer.WriteNumberValue(ScanListenerPortTcp.Value); + } + if (Optional.IsDefined(ScanListenerPortTcpSsl)) + { + writer.WritePropertyName("scanListenerPortTcpSsl"u8); + writer.WriteNumberValue(ScanListenerPortTcpSsl.Value); + } + if (options.Format != "W" && Optional.IsDefined(ListenerPort)) + { + writer.WritePropertyName("listenerPort"u8); + writer.WriteNumberValue(ListenerPort.Value); + } + writer.WritePropertyName("shape"u8); + writer.WriteStringValue(Shape); + writer.WritePropertyName("sshPublicKeys"u8); + writer.WriteStartArray(); + foreach (var item in SshPublicKeys) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(SystemVersion)) + { + writer.WritePropertyName("systemVersion"u8); + writer.WriteStringValue(SystemVersion); + } + if (Optional.IsDefined(TimeZone)) + { + writer.WritePropertyName("timeZone"u8); + writer.WriteStringValue(TimeZone); + } + writer.WritePropertyName("totalEcpuCount"u8); + writer.WriteNumberValue(TotalEcpuCount); + writer.WritePropertyName("vmFileSystemStorage"u8); + writer.WriteObjectValue(VmFileSystemStorage, options); + if (options.Format != "W" && Optional.IsDefined(LifecycleDetails)) + { + writer.WritePropertyName("lifecycleDetails"u8); + writer.WriteStringValue(LifecycleDetails); + } + if (options.Format != "W" && Optional.IsDefined(ScanDnsName)) + { + writer.WritePropertyName("scanDnsName"u8); + writer.WriteStringValue(ScanDnsName); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ScanIPIds)) + { + writer.WritePropertyName("scanIpIds"u8); + writer.WriteStartArray(); + foreach (var item in ScanIPIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ScanDnsRecordId)) + { + writer.WritePropertyName("scanDnsRecordId"u8); + writer.WriteStringValue(ScanDnsRecordId); + } + if (options.Format != "W" && Optional.IsDefined(SnapshotFileSystemStorage)) + { + writer.WritePropertyName("snapshotFileSystemStorage"u8); + writer.WriteObjectValue(SnapshotFileSystemStorage, options); + } + if (options.Format != "W" && Optional.IsDefined(TotalFileSystemStorage)) + { + writer.WritePropertyName("totalFileSystemStorage"u8); + writer.WriteObjectValue(TotalFileSystemStorage, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(VipIds)) + { + writer.WritePropertyName("vipIds"u8); + writer.WriteStartArray(); + foreach (var item in VipIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(OciUri)) + { + writer.WritePropertyName("ociUrl"u8); + writer.WriteStringValue(OciUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(IormConfigCache)) + { + writer.WritePropertyName("iormConfigCache"u8); + writer.WriteObjectValue(IormConfigCache, options); + } + if (options.Format != "W" && Optional.IsDefined(BackupSubnetOcid)) + { + writer.WritePropertyName("backupSubnetOcid"u8); + writer.WriteStringValue(BackupSubnetOcid); + } + if (options.Format != "W" && Optional.IsDefined(SubnetOcid)) + { + writer.WritePropertyName("subnetOcid"u8); + writer.WriteStringValue(SubnetOcid); + } + 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 + } + } + } + + ExadbVmClusterProperties 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(ExadbVmClusterProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExadbVmClusterProperties(document.RootElement, options); + } + + internal static ExadbVmClusterProperties DeserializeExadbVmClusterProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier ocid = default; + string clusterName = default; + string backupSubnetCidr = default; + Uri nsgUrl = default; + OracleDatabaseProvisioningState? provisioningState = default; + ExadbVmClusterLifecycleState? lifecycleState = default; + ResourceIdentifier vnetId = default; + ResourceIdentifier subnetId = default; + DiagnosticCollectionConfig dataCollectionOptions = default; + string displayName = default; + string domain = default; + int enabledEcpuCount = default; + ResourceIdentifier exascaleDBStorageVaultId = default; + ResourceIdentifier gridImageOcid = default; + GridImageType? gridImageType = default; + string giVersion = default; + string hostname = default; + OracleLicenseModel? licenseModel = default; + int? memorySizeInGbs = default; + int nodeCount = default; + IList nsgCidrs = default; + ResourceIdentifier zoneOcid = default; + ResourceIdentifier privateZoneOcid = default; + int? scanListenerPortTcp = default; + int? scanListenerPortTcpSsl = default; + int? listenerPort = default; + string shape = default; + IList sshPublicKeys = default; + string systemVersion = default; + string timeZone = default; + int totalEcpuCount = default; + ExadbVmClusterStorageDetails vmFileSystemStorage = default; + string lifecycleDetails = default; + string scanDnsName = default; + IReadOnlyList scanIPIds = default; + ResourceIdentifier scanDnsRecordId = default; + ExadbVmClusterStorageDetails snapshotFileSystemStorage = default; + ExadbVmClusterStorageDetails totalFileSystemStorage = default; + IReadOnlyList vipIds = default; + Uri ociUrl = default; + ExadataIormConfig iormConfigCache = default; + ResourceIdentifier backupSubnetOcid = default; + ResourceIdentifier subnetOcid = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ocid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ocid = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("clusterName"u8)) + { + clusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("backupSubnetCidr"u8)) + { + backupSubnetCidr = property.Value.GetString(); + continue; + } + if (property.NameEquals("nsgUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nsgUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new OracleDatabaseProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new ExadbVmClusterLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("vnetId"u8)) + { + vnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("dataCollectionOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataCollectionOptions = DiagnosticCollectionConfig.DeserializeDiagnosticCollectionConfig(property.Value, options); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("domain"u8)) + { + domain = property.Value.GetString(); + continue; + } + if (property.NameEquals("enabledEcpuCount"u8)) + { + enabledEcpuCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("exascaleDbStorageVaultId"u8)) + { + exascaleDBStorageVaultId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("gridImageOcid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gridImageOcid = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("gridImageType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gridImageType = new GridImageType(property.Value.GetString()); + continue; + } + if (property.NameEquals("giVersion"u8)) + { + giVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("licenseModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + licenseModel = new OracleLicenseModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("memorySizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memorySizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nodeCount"u8)) + { + nodeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nsgCidrs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CloudVmClusterNsgCidr.DeserializeCloudVmClusterNsgCidr(item, options)); + } + nsgCidrs = array; + continue; + } + if (property.NameEquals("zoneOcid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zoneOcid = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("privateZoneOcid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateZoneOcid = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("scanListenerPortTcp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scanListenerPortTcp = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("scanListenerPortTcpSsl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scanListenerPortTcpSsl = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("listenerPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + listenerPort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("shape"u8)) + { + shape = property.Value.GetString(); + continue; + } + if (property.NameEquals("sshPublicKeys"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sshPublicKeys = array; + continue; + } + if (property.NameEquals("systemVersion"u8)) + { + systemVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeZone"u8)) + { + timeZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("totalEcpuCount"u8)) + { + totalEcpuCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("vmFileSystemStorage"u8)) + { + vmFileSystemStorage = ExadbVmClusterStorageDetails.DeserializeExadbVmClusterStorageDetails(property.Value, options); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("scanDnsName"u8)) + { + scanDnsName = property.Value.GetString(); + continue; + } + if (property.NameEquals("scanIpIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + scanIPIds = array; + continue; + } + if (property.NameEquals("scanDnsRecordId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scanDnsRecordId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("snapshotFileSystemStorage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + snapshotFileSystemStorage = ExadbVmClusterStorageDetails.DeserializeExadbVmClusterStorageDetails(property.Value, options); + continue; + } + if (property.NameEquals("totalFileSystemStorage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalFileSystemStorage = ExadbVmClusterStorageDetails.DeserializeExadbVmClusterStorageDetails(property.Value, options); + continue; + } + if (property.NameEquals("vipIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + vipIds = array; + continue; + } + if (property.NameEquals("ociUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ociUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("iormConfigCache"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iormConfigCache = ExadataIormConfig.DeserializeExadataIormConfig(property.Value, options); + continue; + } + if (property.NameEquals("backupSubnetOcid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backupSubnetOcid = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("subnetOcid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetOcid = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExadbVmClusterProperties( + ocid, + clusterName, + backupSubnetCidr, + nsgUrl, + provisioningState, + lifecycleState, + vnetId, + subnetId, + dataCollectionOptions, + displayName, + domain, + enabledEcpuCount, + exascaleDBStorageVaultId, + gridImageOcid, + gridImageType, + giVersion, + hostname, + licenseModel, + memorySizeInGbs, + nodeCount, + nsgCidrs ?? new ChangeTrackingList(), + zoneOcid, + privateZoneOcid, + scanListenerPortTcp, + scanListenerPortTcpSsl, + listenerPort, + shape, + sshPublicKeys, + systemVersion, + timeZone, + totalEcpuCount, + vmFileSystemStorage, + lifecycleDetails, + scanDnsName, + scanIPIds ?? new ChangeTrackingList(), + scanDnsRecordId, + snapshotFileSystemStorage, + totalFileSystemStorage, + vipIds ?? new ChangeTrackingList(), + ociUrl, + iormConfigCache, + backupSubnetOcid, + subnetOcid, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExadbVmClusterProperties)} does not support writing '{options.Format}' format."); + } + } + + ExadbVmClusterProperties 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 DeserializeExadbVmClusterProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExadbVmClusterProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.cs new file mode 100644 index 000000000000..2445da01c4f6 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.cs @@ -0,0 +1,297 @@ +// 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.OracleDatabase.Models +{ + /// ExadbVmCluster resource model. + public partial class ExadbVmClusterProperties + { + /// + /// 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 . + /// VNET for network connectivity. + /// Client subnet. + /// Display Name. + /// The number of ECPUs to enable for an Exadata VM cluster on Exascale Infrastructure. + /// The Azure Resource ID of the Exadata Database Storage Vault. + /// The hostname for the Exadata VM cluster on Exascale Infrastructure. + /// The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + /// The shape of the Exadata VM cluster on Exascale Infrastructure resource. + /// The public key portion of one or more key pairs used for SSH access to the Exadata VM cluster on Exascale Infrastructure. + /// The number of Total ECPUs for an Exadata VM cluster on Exascale Infrastructure. + /// Filesystem storage details. + /// , , , , , , or is null. + public ExadbVmClusterProperties(ResourceIdentifier vnetId, ResourceIdentifier subnetId, string displayName, int enabledEcpuCount, ResourceIdentifier exascaleDBStorageVaultId, string hostname, int nodeCount, string shape, IEnumerable sshPublicKeys, int totalEcpuCount, ExadbVmClusterStorageDetails vmFileSystemStorage) + { + Argument.AssertNotNull(vnetId, nameof(vnetId)); + Argument.AssertNotNull(subnetId, nameof(subnetId)); + Argument.AssertNotNull(displayName, nameof(displayName)); + Argument.AssertNotNull(exascaleDBStorageVaultId, nameof(exascaleDBStorageVaultId)); + Argument.AssertNotNull(hostname, nameof(hostname)); + Argument.AssertNotNull(shape, nameof(shape)); + Argument.AssertNotNull(sshPublicKeys, nameof(sshPublicKeys)); + Argument.AssertNotNull(vmFileSystemStorage, nameof(vmFileSystemStorage)); + + VnetId = vnetId; + SubnetId = subnetId; + DisplayName = displayName; + EnabledEcpuCount = enabledEcpuCount; + ExascaleDBStorageVaultId = exascaleDBStorageVaultId; + Hostname = hostname; + NodeCount = nodeCount; + NsgCidrs = new ChangeTrackingList(); + Shape = shape; + SshPublicKeys = sshPublicKeys.ToList(); + TotalEcpuCount = totalEcpuCount; + VmFileSystemStorage = vmFileSystemStorage; + ScanIPIds = new ChangeTrackingList(); + VipIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// ExadbVmCluster ocid. + /// The cluster name for Exadata VM cluster on Exascale Infrastructure. The cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + /// Client OCI backup subnet CIDR, default is 192.168.252.0/22. + /// HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface. + /// Exadata VM cluster on Exascale Infrastructure provisioning state. + /// CloudVmCluster lifecycle state. + /// VNET for network connectivity. + /// Client subnet. + /// Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + /// Display Name. + /// A domain name used for the Exadata VM cluster on Exascale Infrastructure. + /// The number of ECPUs to enable for an Exadata VM cluster on Exascale Infrastructure. + /// The Azure Resource ID of the Exadata Database Storage Vault. + /// Grid Setup will be done using this Grid Image OCID. Can be obtained using giMinorVersions API. + /// The type of Grid Image. + /// Oracle Grid Infrastructure (GI) software version. + /// The hostname for the Exadata VM cluster on Exascale Infrastructure. + /// The Oracle license model that applies to the Exadata VM cluster on Exascale Infrastructure. The default is LICENSE_INCLUDED. + /// The memory that you want to be allocated in GBs. Memory is calculated based on 11 GB per VM core reserved. + /// The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + /// CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster will be added by default. + /// The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with. + /// The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with. + /// The TCP Single Client Access Name (SCAN) port. The default port is 1521. + /// The TCPS Single Client Access Name (SCAN) port. The default port is 2484. + /// The port number configured for the listener on the Exadata VM cluster on Exascale Infrastructure. + /// The shape of the Exadata VM cluster on Exascale Infrastructure resource. + /// The public key portion of one or more key pairs used for SSH access to the Exadata VM cluster on Exascale Infrastructure. + /// Operating system version of the image. + /// The time zone of the Exadata VM cluster on Exascale Infrastructure. For details, see [Exadata Infrastructure Time Zones](/Content/Database/References/timezones.htm). + /// The number of Total ECPUs for an Exadata VM cluster on Exascale Infrastructure. + /// Filesystem storage details. + /// Additional information about the current lifecycle state. + /// The FQDN of the DNS record for the SCAN IP addresses that are associated with the Exadata VM cluster on Exascale Infrastructure. + /// The Single Client Access Name (SCAN) IP addresses associated with the Exadata VM cluster on Exascale Infrastructure. SCAN IP addresses are typically used for load balancing and are not assigned to any interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. **Note:** For a single-node DB system, this list is empty. + /// The OCID of the DNS record for the SCAN IP addresses that are associated with the Exadata VM cluster on Exascale Infrastructure. + /// Snapshot filesystem storage details. + /// Total file system storage details. + /// The virtual IP (VIP) addresses associated with the Exadata VM cluster on Exascale Infrastructure. The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata Cloud Service instance to enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. **Note:** For a single-node DB system, this list is empty. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// iormConfigCache details for Exadata VM cluster on Exascale Infrastructure. + /// Cluster backup subnet ocid. + /// Cluster subnet ocid. + /// Keeps track of any properties unknown to the library. + internal ExadbVmClusterProperties(ResourceIdentifier ocid, string clusterName, string backupSubnetCidr, Uri nsgUri, OracleDatabaseProvisioningState? provisioningState, ExadbVmClusterLifecycleState? lifecycleState, ResourceIdentifier vnetId, ResourceIdentifier subnetId, DiagnosticCollectionConfig dataCollectionOptions, string displayName, string domain, int enabledEcpuCount, ResourceIdentifier exascaleDBStorageVaultId, ResourceIdentifier gridImageOcid, GridImageType? gridImageType, string giVersion, string hostname, OracleLicenseModel? licenseModel, int? memorySizeInGbs, int nodeCount, IList nsgCidrs, ResourceIdentifier zoneOcid, ResourceIdentifier privateZoneOcid, int? scanListenerPortTcp, int? scanListenerPortTcpSsl, int? listenerPort, string shape, IList sshPublicKeys, string systemVersion, string timeZone, int totalEcpuCount, ExadbVmClusterStorageDetails vmFileSystemStorage, string lifecycleDetails, string scanDnsName, IReadOnlyList scanIPIds, ResourceIdentifier scanDnsRecordId, ExadbVmClusterStorageDetails snapshotFileSystemStorage, ExadbVmClusterStorageDetails totalFileSystemStorage, IReadOnlyList vipIds, Uri ociUri, ExadataIormConfig iormConfigCache, ResourceIdentifier backupSubnetOcid, ResourceIdentifier subnetOcid, IDictionary serializedAdditionalRawData) + { + Ocid = ocid; + ClusterName = clusterName; + BackupSubnetCidr = backupSubnetCidr; + NsgUri = nsgUri; + ProvisioningState = provisioningState; + LifecycleState = lifecycleState; + VnetId = vnetId; + SubnetId = subnetId; + DataCollectionOptions = dataCollectionOptions; + DisplayName = displayName; + Domain = domain; + EnabledEcpuCount = enabledEcpuCount; + ExascaleDBStorageVaultId = exascaleDBStorageVaultId; + GridImageOcid = gridImageOcid; + GridImageType = gridImageType; + GiVersion = giVersion; + Hostname = hostname; + LicenseModel = licenseModel; + MemorySizeInGbs = memorySizeInGbs; + NodeCount = nodeCount; + NsgCidrs = nsgCidrs; + ZoneOcid = zoneOcid; + PrivateZoneOcid = privateZoneOcid; + ScanListenerPortTcp = scanListenerPortTcp; + ScanListenerPortTcpSsl = scanListenerPortTcpSsl; + ListenerPort = listenerPort; + Shape = shape; + SshPublicKeys = sshPublicKeys; + SystemVersion = systemVersion; + TimeZone = timeZone; + TotalEcpuCount = totalEcpuCount; + VmFileSystemStorage = vmFileSystemStorage; + LifecycleDetails = lifecycleDetails; + ScanDnsName = scanDnsName; + ScanIPIds = scanIPIds; + ScanDnsRecordId = scanDnsRecordId; + SnapshotFileSystemStorage = snapshotFileSystemStorage; + TotalFileSystemStorage = totalFileSystemStorage; + VipIds = vipIds; + OciUri = ociUri; + IormConfigCache = iormConfigCache; + BackupSubnetOcid = backupSubnetOcid; + SubnetOcid = subnetOcid; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExadbVmClusterProperties() + { + } + + /// ExadbVmCluster ocid. + public ResourceIdentifier Ocid { get; } + /// The cluster name for Exadata VM cluster on Exascale Infrastructure. The cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + public string ClusterName { get; set; } + /// Client OCI backup subnet CIDR, default is 192.168.252.0/22. + public string BackupSubnetCidr { get; set; } + /// HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface. + public Uri NsgUri { get; } + /// Exadata VM cluster on Exascale Infrastructure provisioning state. + public OracleDatabaseProvisioningState? ProvisioningState { get; } + /// CloudVmCluster lifecycle state. + public ExadbVmClusterLifecycleState? LifecycleState { get; } + /// VNET for network connectivity. + public ResourceIdentifier VnetId { get; set; } + /// Client subnet. + public ResourceIdentifier SubnetId { get; set; } + /// Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + public DiagnosticCollectionConfig DataCollectionOptions { get; set; } + /// Display Name. + public string DisplayName { get; set; } + /// A domain name used for the Exadata VM cluster on Exascale Infrastructure. + public string Domain { get; set; } + /// The number of ECPUs to enable for an Exadata VM cluster on Exascale Infrastructure. + public int EnabledEcpuCount { get; set; } + /// The Azure Resource ID of the Exadata Database Storage Vault. + public ResourceIdentifier ExascaleDBStorageVaultId { get; set; } + /// Grid Setup will be done using this Grid Image OCID. Can be obtained using giMinorVersions API. + public ResourceIdentifier GridImageOcid { get; set; } + /// The type of Grid Image. + public GridImageType? GridImageType { get; } + /// Oracle Grid Infrastructure (GI) software version. + public string GiVersion { get; } + /// The hostname for the Exadata VM cluster on Exascale Infrastructure. + public string Hostname { get; set; } + /// The Oracle license model that applies to the Exadata VM cluster on Exascale Infrastructure. The default is LICENSE_INCLUDED. + public OracleLicenseModel? LicenseModel { get; set; } + /// The memory that you want to be allocated in GBs. Memory is calculated based on 11 GB per VM core reserved. + public int? MemorySizeInGbs { get; } + /// The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + public int NodeCount { get; set; } + /// CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster will be added by default. + public IList NsgCidrs { get; } + /// The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with. + public ResourceIdentifier ZoneOcid { get; } + /// The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with. + public ResourceIdentifier PrivateZoneOcid { get; set; } + /// The TCP Single Client Access Name (SCAN) port. The default port is 1521. + public int? ScanListenerPortTcp { get; set; } + /// The TCPS Single Client Access Name (SCAN) port. The default port is 2484. + public int? ScanListenerPortTcpSsl { get; set; } + /// The port number configured for the listener on the Exadata VM cluster on Exascale Infrastructure. + public int? ListenerPort { get; } + /// The shape of the Exadata VM cluster on Exascale Infrastructure resource. + public string Shape { get; set; } + /// The public key portion of one or more key pairs used for SSH access to the Exadata VM cluster on Exascale Infrastructure. + public IList SshPublicKeys { get; } + /// Operating system version of the image. + public string SystemVersion { get; set; } + /// The time zone of the Exadata VM cluster on Exascale Infrastructure. For details, see [Exadata Infrastructure Time Zones](/Content/Database/References/timezones.htm). + public string TimeZone { get; set; } + /// The number of Total ECPUs for an Exadata VM cluster on Exascale Infrastructure. + public int TotalEcpuCount { get; set; } + /// Filesystem storage details. + internal ExadbVmClusterStorageDetails VmFileSystemStorage { get; set; } + /// Total Capacity. + public int? VmFileSystemStorageTotalSizeInGbs + { + get => VmFileSystemStorage is null ? default(int?) : VmFileSystemStorage.TotalSizeInGbs; + set + { + VmFileSystemStorage = value.HasValue ? new ExadbVmClusterStorageDetails(value.Value) : null; + } + } + + /// Additional information about the current lifecycle state. + public string LifecycleDetails { get; } + /// The FQDN of the DNS record for the SCAN IP addresses that are associated with the Exadata VM cluster on Exascale Infrastructure. + public string ScanDnsName { get; } + /// The Single Client Access Name (SCAN) IP addresses associated with the Exadata VM cluster on Exascale Infrastructure. SCAN IP addresses are typically used for load balancing and are not assigned to any interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. **Note:** For a single-node DB system, this list is empty. + public IReadOnlyList ScanIPIds { get; } + /// The OCID of the DNS record for the SCAN IP addresses that are associated with the Exadata VM cluster on Exascale Infrastructure. + public ResourceIdentifier ScanDnsRecordId { get; } + /// Snapshot filesystem storage details. + internal ExadbVmClusterStorageDetails SnapshotFileSystemStorage { get; } + /// Total Capacity. + public int? SnapshotFileSystemStorageTotalSizeInGbs + { + get => SnapshotFileSystemStorage?.TotalSizeInGbs; + } + + /// Total file system storage details. + internal ExadbVmClusterStorageDetails TotalFileSystemStorage { get; } + /// Total Capacity. + public int? TotalSizeInGbs + { + get => TotalFileSystemStorage?.TotalSizeInGbs; + } + + /// The virtual IP (VIP) addresses associated with the Exadata VM cluster on Exascale Infrastructure. The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata Cloud Service instance to enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. **Note:** For a single-node DB system, this list is empty. + public IReadOnlyList VipIds { get; } + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + public Uri OciUri { get; } + /// iormConfigCache details for Exadata VM cluster on Exascale Infrastructure. + public ExadataIormConfig IormConfigCache { get; } + /// Cluster backup subnet ocid. + public ResourceIdentifier BackupSubnetOcid { get; } + /// Cluster subnet ocid. + public ResourceIdentifier SubnetOcid { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.Serialization.cs new file mode 100644 index 000000000000..28ec6f2eb1aa --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.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.OracleDatabase.Models +{ + public partial class ExadbVmClusterStorageDetails : 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(ExadbVmClusterStorageDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("totalSizeInGbs"u8); + writer.WriteNumberValue(TotalSizeInGbs); + 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 + } + } + } + + ExadbVmClusterStorageDetails 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(ExadbVmClusterStorageDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExadbVmClusterStorageDetails(document.RootElement, options); + } + + internal static ExadbVmClusterStorageDetails DeserializeExadbVmClusterStorageDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int totalSizeInGbs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("totalSizeInGbs"u8)) + { + totalSizeInGbs = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExadbVmClusterStorageDetails(totalSizeInGbs, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExadbVmClusterStorageDetails)} does not support writing '{options.Format}' format."); + } + } + + ExadbVmClusterStorageDetails 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 DeserializeExadbVmClusterStorageDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExadbVmClusterStorageDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.cs new file mode 100644 index 000000000000..0ba79b60cc13 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Storage Details on the Exadata VM cluster. + public partial class ExadbVmClusterStorageDetails + { + /// + /// 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 . + /// Total Capacity. + public ExadbVmClusterStorageDetails(int totalSizeInGbs) + { + TotalSizeInGbs = totalSizeInGbs; + } + + /// Initializes a new instance of . + /// Total Capacity. + /// Keeps track of any properties unknown to the library. + internal ExadbVmClusterStorageDetails(int totalSizeInGbs, IDictionary serializedAdditionalRawData) + { + TotalSizeInGbs = totalSizeInGbs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExadbVmClusterStorageDetails() + { + } + + /// Total Capacity. + public int TotalSizeInGbs { get; set; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..bde831f19ebd --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.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.OracleDatabase.Models +{ + internal partial class ExadbVmClusterUpdateProperties : 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(ExadbVmClusterUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NodeCount)) + { + writer.WritePropertyName("nodeCount"u8); + writer.WriteNumberValue(NodeCount.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 + } + } + } + + ExadbVmClusterUpdateProperties 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(ExadbVmClusterUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExadbVmClusterUpdateProperties(document.RootElement, options); + } + + internal static ExadbVmClusterUpdateProperties DeserializeExadbVmClusterUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? nodeCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nodeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExadbVmClusterUpdateProperties(nodeCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExadbVmClusterUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + ExadbVmClusterUpdateProperties 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 DeserializeExadbVmClusterUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExadbVmClusterUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.cs new file mode 100644 index 000000000000..3ac212e4beed --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// The updatable properties of the ExadbVmCluster. + internal partial class ExadbVmClusterUpdateProperties + { + /// + /// 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 ExadbVmClusterUpdateProperties() + { + } + + /// Initializes a new instance of . + /// The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + /// Keeps track of any properties unknown to the library. + internal ExadbVmClusterUpdateProperties(int? nodeCount, IDictionary serializedAdditionalRawData) + { + NodeCount = nodeCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + public int? NodeCount { get; set; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeListResult.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeListResult.Serialization.cs new file mode 100644 index 000000000000..00bfd6f01781 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeListResult.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.OracleDatabase.Models +{ + internal partial class ExascaleDBNodeListResult : 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(ExascaleDBNodeListResult)} 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 + } + } + } + + ExascaleDBNodeListResult 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(ExascaleDBNodeListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDBNodeListResult(document.RootElement, options); + } + + internal static ExascaleDBNodeListResult DeserializeExascaleDBNodeListResult(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(ExascaleDBNodeData.DeserializeExascaleDBNodeData(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 ExascaleDBNodeListResult(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); + default: + throw new FormatException($"The model {nameof(ExascaleDBNodeListResult)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDBNodeListResult 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 DeserializeExascaleDBNodeListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDBNodeListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeListResult.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeListResult.cs new file mode 100644 index 000000000000..0296070b397d --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeListResult.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.OracleDatabase.Models +{ + /// The response of a ExascaleDbNode list operation. + internal partial class ExascaleDBNodeListResult + { + /// + /// 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 ExascaleDbNode items on this page. + /// is null. + internal ExascaleDBNodeListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ExascaleDbNode items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ExascaleDBNodeListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExascaleDBNodeListResult() + { + } + + /// The ExascaleDbNode items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeProperties.Serialization.cs new file mode 100644 index 000000000000..fc8b2ff254e0 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeProperties.Serialization.cs @@ -0,0 +1,304 @@ +// 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.OracleDatabase.Models +{ + public partial class ExascaleDBNodeProperties : 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(ExascaleDBNodeProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + if (Optional.IsDefined(AdditionalDetails)) + { + writer.WritePropertyName("additionalDetails"u8); + writer.WriteStringValue(AdditionalDetails); + } + if (Optional.IsDefined(CpuCoreCount)) + { + writer.WritePropertyName("cpuCoreCount"u8); + writer.WriteNumberValue(CpuCoreCount.Value); + } + if (Optional.IsDefined(DBNodeStorageSizeInGbs)) + { + writer.WritePropertyName("dbNodeStorageSizeInGbs"u8); + writer.WriteNumberValue(DBNodeStorageSizeInGbs.Value); + } + if (Optional.IsDefined(FaultDomain)) + { + writer.WritePropertyName("faultDomain"u8); + writer.WriteStringValue(FaultDomain); + } + if (Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + } + if (Optional.IsDefined(LifecycleState)) + { + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.Value.ToString()); + } + if (Optional.IsDefined(MaintenanceType)) + { + writer.WritePropertyName("maintenanceType"u8); + writer.WriteStringValue(MaintenanceType); + } + if (Optional.IsDefined(MemorySizeInGbs)) + { + writer.WritePropertyName("memorySizeInGbs"u8); + writer.WriteNumberValue(MemorySizeInGbs.Value); + } + if (Optional.IsDefined(SoftwareStorageSizeInGb)) + { + writer.WritePropertyName("softwareStorageSizeInGb"u8); + writer.WriteNumberValue(SoftwareStorageSizeInGb.Value); + } + if (Optional.IsDefined(TimeMaintenanceWindowEnd)) + { + writer.WritePropertyName("timeMaintenanceWindowEnd"u8); + writer.WriteStringValue(TimeMaintenanceWindowEnd.Value, "O"); + } + if (Optional.IsDefined(TimeMaintenanceWindowStart)) + { + writer.WritePropertyName("timeMaintenanceWindowStart"u8); + writer.WriteStringValue(TimeMaintenanceWindowStart.Value, "O"); + } + if (Optional.IsDefined(TotalCpuCoreCount)) + { + writer.WritePropertyName("totalCpuCoreCount"u8); + writer.WriteNumberValue(TotalCpuCoreCount.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 + } + } + } + + ExascaleDBNodeProperties 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(ExascaleDBNodeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDBNodeProperties(document.RootElement, options); + } + + internal static ExascaleDBNodeProperties DeserializeExascaleDBNodeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier ocid = default; + string additionalDetails = default; + int? cpuCoreCount = default; + int? dbNodeStorageSizeInGbs = default; + string faultDomain = default; + string hostname = default; + DBNodeProvisioningState? lifecycleState = default; + string maintenanceType = default; + int? memorySizeInGbs = default; + int? softwareStorageSizeInGb = default; + DateTimeOffset? timeMaintenanceWindowEnd = default; + DateTimeOffset? timeMaintenanceWindowStart = default; + int? totalCpuCoreCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ocid"u8)) + { + ocid = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("additionalDetails"u8)) + { + additionalDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("cpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dbNodeStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbNodeStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("faultDomain"u8)) + { + faultDomain = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new DBNodeProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("maintenanceType"u8)) + { + maintenanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("memorySizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memorySizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("softwareStorageSizeInGb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softwareStorageSizeInGb = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeMaintenanceWindowEnd"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceWindowEnd = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceWindowStart"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceWindowStart = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("totalCpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalCpuCoreCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExascaleDBNodeProperties( + ocid, + additionalDetails, + cpuCoreCount, + dbNodeStorageSizeInGbs, + faultDomain, + hostname, + lifecycleState, + maintenanceType, + memorySizeInGbs, + softwareStorageSizeInGb, + timeMaintenanceWindowEnd, + timeMaintenanceWindowStart, + totalCpuCoreCount, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExascaleDBNodeProperties)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDBNodeProperties 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 DeserializeExascaleDBNodeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDBNodeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeProperties.cs new file mode 100644 index 000000000000..422dccb833e2 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBNodeProperties.cs @@ -0,0 +1,124 @@ +// 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.OracleDatabase.Models +{ + /// The properties of DbNodeResource. + public partial class ExascaleDBNodeProperties + { + /// + /// 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 . + /// DbNode OCID. + /// is null. + public ExascaleDBNodeProperties(ResourceIdentifier ocid) + { + Argument.AssertNotNull(ocid, nameof(ocid)); + + Ocid = ocid; + } + + /// Initializes a new instance of . + /// DbNode OCID. + /// Additional information about the planned maintenance. + /// The number of CPU cores enabled on the Db node. + /// The allocated local node storage in GBs on the Db node. + /// The name of the Fault Domain the instance is contained in. + /// The host name for the database node. + /// The current state of the database node. + /// The type of database node maintenance. + /// The allocated memory in GBs on the Db node. + /// The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine DB systems. + /// End date and time of maintenance window. + /// Start date and time of maintenance window. + /// The total number of CPU cores reserved on the Db node. + /// Keeps track of any properties unknown to the library. + internal ExascaleDBNodeProperties(ResourceIdentifier ocid, string additionalDetails, int? cpuCoreCount, int? dbNodeStorageSizeInGbs, string faultDomain, string hostname, DBNodeProvisioningState? lifecycleState, string maintenanceType, int? memorySizeInGbs, int? softwareStorageSizeInGb, DateTimeOffset? timeMaintenanceWindowEnd, DateTimeOffset? timeMaintenanceWindowStart, int? totalCpuCoreCount, IDictionary serializedAdditionalRawData) + { + Ocid = ocid; + AdditionalDetails = additionalDetails; + CpuCoreCount = cpuCoreCount; + DBNodeStorageSizeInGbs = dbNodeStorageSizeInGbs; + FaultDomain = faultDomain; + Hostname = hostname; + LifecycleState = lifecycleState; + MaintenanceType = maintenanceType; + MemorySizeInGbs = memorySizeInGbs; + SoftwareStorageSizeInGb = softwareStorageSizeInGb; + TimeMaintenanceWindowEnd = timeMaintenanceWindowEnd; + TimeMaintenanceWindowStart = timeMaintenanceWindowStart; + TotalCpuCoreCount = totalCpuCoreCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExascaleDBNodeProperties() + { + } + + /// DbNode OCID. + public ResourceIdentifier Ocid { get; set; } + /// Additional information about the planned maintenance. + public string AdditionalDetails { get; set; } + /// The number of CPU cores enabled on the Db node. + public int? CpuCoreCount { get; set; } + /// The allocated local node storage in GBs on the Db node. + public int? DBNodeStorageSizeInGbs { get; set; } + /// The name of the Fault Domain the instance is contained in. + public string FaultDomain { get; set; } + /// The host name for the database node. + public string Hostname { get; set; } + /// The current state of the database node. + public DBNodeProvisioningState? LifecycleState { get; set; } + /// The type of database node maintenance. + public string MaintenanceType { get; set; } + /// The allocated memory in GBs on the Db node. + public int? MemorySizeInGbs { get; set; } + /// The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine DB systems. + public int? SoftwareStorageSizeInGb { get; set; } + /// End date and time of maintenance window. + public DateTimeOffset? TimeMaintenanceWindowEnd { get; set; } + /// Start date and time of maintenance window. + public DateTimeOffset? TimeMaintenanceWindowStart { get; set; } + /// The total number of CPU cores reserved on the Db node. + public int? TotalCpuCoreCount { get; set; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageDetails.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageDetails.Serialization.cs new file mode 100644 index 000000000000..58fc0ec6706a --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageDetails.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.OracleDatabase.Models +{ + public partial class ExascaleDBStorageDetails : 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(ExascaleDBStorageDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AvailableSizeInGbs)) + { + writer.WritePropertyName("availableSizeInGbs"u8); + writer.WriteNumberValue(AvailableSizeInGbs.Value); + } + if (Optional.IsDefined(TotalSizeInGbs)) + { + writer.WritePropertyName("totalSizeInGbs"u8); + writer.WriteNumberValue(TotalSizeInGbs.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 + } + } + } + + ExascaleDBStorageDetails 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(ExascaleDBStorageDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDBStorageDetails(document.RootElement, options); + } + + internal static ExascaleDBStorageDetails DeserializeExascaleDBStorageDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? availableSizeInGbs = default; + int? totalSizeInGbs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("availableSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("totalSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalSizeInGbs = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExascaleDBStorageDetails(availableSizeInGbs, totalSizeInGbs, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExascaleDBStorageDetails)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDBStorageDetails 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 DeserializeExascaleDBStorageDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDBStorageDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageDetails.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageDetails.cs new file mode 100644 index 000000000000..05fea47a195e --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageDetails.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.OracleDatabase.Models +{ + /// Exadata Database Storage Details. + public partial class ExascaleDBStorageDetails + { + /// + /// 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 ExascaleDBStorageDetails() + { + } + + /// Initializes a new instance of . + /// Available Capacity. + /// Total Capacity. + /// Keeps track of any properties unknown to the library. + internal ExascaleDBStorageDetails(int? availableSizeInGbs, int? totalSizeInGbs, IDictionary serializedAdditionalRawData) + { + AvailableSizeInGbs = availableSizeInGbs; + TotalSizeInGbs = totalSizeInGbs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Available Capacity. + public int? AvailableSizeInGbs { get; } + /// Total Capacity. + public int? TotalSizeInGbs { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageInputDetails.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageInputDetails.Serialization.cs new file mode 100644 index 000000000000..05f682a4d208 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageInputDetails.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.OracleDatabase.Models +{ + public partial class ExascaleDBStorageInputDetails : 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(ExascaleDBStorageInputDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("totalSizeInGbs"u8); + writer.WriteNumberValue(TotalSizeInGbs); + 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 + } + } + } + + ExascaleDBStorageInputDetails 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(ExascaleDBStorageInputDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDBStorageInputDetails(document.RootElement, options); + } + + internal static ExascaleDBStorageInputDetails DeserializeExascaleDBStorageInputDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int totalSizeInGbs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("totalSizeInGbs"u8)) + { + totalSizeInGbs = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExascaleDBStorageInputDetails(totalSizeInGbs, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExascaleDBStorageInputDetails)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDBStorageInputDetails 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 DeserializeExascaleDBStorageInputDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDBStorageInputDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageInputDetails.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageInputDetails.cs new file mode 100644 index 000000000000..8375ebe725dd --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageInputDetails.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Create exadata Database Storage Details model. + public partial class ExascaleDBStorageInputDetails + { + /// + /// 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 . + /// Total Capacity. + public ExascaleDBStorageInputDetails(int totalSizeInGbs) + { + TotalSizeInGbs = totalSizeInGbs; + } + + /// Initializes a new instance of . + /// Total Capacity. + /// Keeps track of any properties unknown to the library. + internal ExascaleDBStorageInputDetails(int totalSizeInGbs, IDictionary serializedAdditionalRawData) + { + TotalSizeInGbs = totalSizeInGbs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExascaleDBStorageInputDetails() + { + } + + /// Total Capacity. + public int TotalSizeInGbs { get; set; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultLifecycleState.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultLifecycleState.cs new file mode 100644 index 000000000000..59b8a3b9a778 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultLifecycleState.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.OracleDatabase.Models +{ + /// Exadata Database Storage Vault lifecycle state enum. + public readonly partial struct ExascaleDBStorageVaultLifecycleState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ExascaleDBStorageVaultLifecycleState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProvisioningValue = "Provisioning"; + private const string AvailableValue = "Available"; + private const string UpdatingValue = "Updating"; + private const string TerminatingValue = "Terminating"; + private const string TerminatedValue = "Terminated"; + private const string FailedValue = "Failed"; + + /// Indicates that resource in Provisioning state. + public static ExascaleDBStorageVaultLifecycleState Provisioning { get; } = new ExascaleDBStorageVaultLifecycleState(ProvisioningValue); + /// Indicates that resource in Available state. + public static ExascaleDBStorageVaultLifecycleState Available { get; } = new ExascaleDBStorageVaultLifecycleState(AvailableValue); + /// Indicates that resource in Updating state. + public static ExascaleDBStorageVaultLifecycleState Updating { get; } = new ExascaleDBStorageVaultLifecycleState(UpdatingValue); + /// Indicates that resource in Terminating state. + public static ExascaleDBStorageVaultLifecycleState Terminating { get; } = new ExascaleDBStorageVaultLifecycleState(TerminatingValue); + /// Indicates that resource in Terminated state. + public static ExascaleDBStorageVaultLifecycleState Terminated { get; } = new ExascaleDBStorageVaultLifecycleState(TerminatedValue); + /// Indicates that resource in Failed state. + public static ExascaleDBStorageVaultLifecycleState Failed { get; } = new ExascaleDBStorageVaultLifecycleState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(ExascaleDBStorageVaultLifecycleState left, ExascaleDBStorageVaultLifecycleState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ExascaleDBStorageVaultLifecycleState left, ExascaleDBStorageVaultLifecycleState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ExascaleDBStorageVaultLifecycleState(string value) => new ExascaleDBStorageVaultLifecycleState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ExascaleDBStorageVaultLifecycleState other && Equals(other); + /// + public bool Equals(ExascaleDBStorageVaultLifecycleState 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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultListResult.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultListResult.Serialization.cs new file mode 100644 index 000000000000..acb1ec3f8dea --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultListResult.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.OracleDatabase.Models +{ + internal partial class ExascaleDBStorageVaultListResult : 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(ExascaleDBStorageVaultListResult)} 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 + } + } + } + + ExascaleDBStorageVaultListResult 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(ExascaleDBStorageVaultListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDBStorageVaultListResult(document.RootElement, options); + } + + internal static ExascaleDBStorageVaultListResult DeserializeExascaleDBStorageVaultListResult(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(ExascaleDBStorageVaultData.DeserializeExascaleDBStorageVaultData(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 ExascaleDBStorageVaultListResult(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); + default: + throw new FormatException($"The model {nameof(ExascaleDBStorageVaultListResult)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDBStorageVaultListResult 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 DeserializeExascaleDBStorageVaultListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDBStorageVaultListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultListResult.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultListResult.cs new file mode 100644 index 000000000000..fed95cf0db48 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultListResult.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.OracleDatabase.Models +{ + /// The response of a ExascaleDbStorageVault list operation. + internal partial class ExascaleDBStorageVaultListResult + { + /// + /// 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 ExascaleDbStorageVault items on this page. + /// is null. + internal ExascaleDBStorageVaultListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ExascaleDbStorageVault items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ExascaleDBStorageVaultListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExascaleDBStorageVaultListResult() + { + } + + /// The ExascaleDbStorageVault items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultPatch.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultPatch.Serialization.cs new file mode 100644 index 000000000000..71c9163a24a1 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultPatch.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.OracleDatabase.Models +{ + public partial class ExascaleDBStorageVaultPatch : 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(ExascaleDBStorageVaultPatch)} does not support writing '{format}' format."); + } + + 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 (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 + } + } + } + + ExascaleDBStorageVaultPatch 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(ExascaleDBStorageVaultPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDBStorageVaultPatch(document.RootElement, options); + } + + internal static ExascaleDBStorageVaultPatch DeserializeExascaleDBStorageVaultPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = 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 (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExascaleDBStorageVaultPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExascaleDBStorageVaultPatch)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDBStorageVaultPatch 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 DeserializeExascaleDBStorageVaultPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDBStorageVaultPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultPatch.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultPatch.cs new file mode 100644 index 000000000000..5f5e771bd067 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultPatch.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.OracleDatabase.Models +{ + /// The type used for updating tags in ExascaleDbStorageVault resources. + public partial class ExascaleDBStorageVaultPatch + { + /// + /// 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 ExascaleDBStorageVaultPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Keeps track of any properties unknown to the library. + internal ExascaleDBStorageVaultPatch(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultProperties.Serialization.cs new file mode 100644 index 000000000000..9ea1bef0520d --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultProperties.Serialization.cs @@ -0,0 +1,285 @@ +// 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.OracleDatabase.Models +{ + public partial class ExascaleDBStorageVaultProperties : 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(ExascaleDBStorageVaultProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AdditionalFlashCacheInPercent)) + { + writer.WritePropertyName("additionalFlashCacheInPercent"u8); + writer.WriteNumberValue(AdditionalFlashCacheInPercent.Value); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + writer.WritePropertyName("highCapacityDatabaseStorageInput"u8); + writer.WriteObjectValue(HighCapacityDatabaseStorageInput, options); + if (options.Format != "W" && Optional.IsDefined(HighCapacityDatabaseStorage)) + { + writer.WritePropertyName("highCapacityDatabaseStorage"u8); + writer.WriteObjectValue(HighCapacityDatabaseStorage, options); + } + if (Optional.IsDefined(TimeZone)) + { + writer.WritePropertyName("timeZone"u8); + writer.WriteStringValue(TimeZone); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleState)) + { + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleDetails)) + { + writer.WritePropertyName("lifecycleDetails"u8); + writer.WriteStringValue(LifecycleDetails); + } + if (options.Format != "W" && Optional.IsDefined(VmClusterCount)) + { + writer.WritePropertyName("vmClusterCount"u8); + writer.WriteNumberValue(VmClusterCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(Ocid)) + { + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + } + if (options.Format != "W" && Optional.IsDefined(OciUri)) + { + writer.WritePropertyName("ociUrl"u8); + writer.WriteStringValue(OciUri.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 + } + } + } + + ExascaleDBStorageVaultProperties 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(ExascaleDBStorageVaultProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDBStorageVaultProperties(document.RootElement, options); + } + + internal static ExascaleDBStorageVaultProperties DeserializeExascaleDBStorageVaultProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? additionalFlashCacheInPercent = default; + string description = default; + string displayName = default; + ExascaleDBStorageInputDetails highCapacityDatabaseStorageInput = default; + ExascaleDBStorageDetails highCapacityDatabaseStorage = default; + string timeZone = default; + OracleDatabaseProvisioningState? provisioningState = default; + ExascaleDBStorageVaultLifecycleState? lifecycleState = default; + string lifecycleDetails = default; + int? vmClusterCount = default; + ResourceIdentifier ocid = default; + Uri ociUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("additionalFlashCacheInPercent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + additionalFlashCacheInPercent = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("highCapacityDatabaseStorageInput"u8)) + { + highCapacityDatabaseStorageInput = ExascaleDBStorageInputDetails.DeserializeExascaleDBStorageInputDetails(property.Value, options); + continue; + } + if (property.NameEquals("highCapacityDatabaseStorage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highCapacityDatabaseStorage = ExascaleDBStorageDetails.DeserializeExascaleDBStorageDetails(property.Value, options); + continue; + } + if (property.NameEquals("timeZone"u8)) + { + timeZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new OracleDatabaseProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new ExascaleDBStorageVaultLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("vmClusterCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vmClusterCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("ocid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ocid = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("ociUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ociUrl = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExascaleDBStorageVaultProperties( + additionalFlashCacheInPercent, + description, + displayName, + highCapacityDatabaseStorageInput, + highCapacityDatabaseStorage, + timeZone, + provisioningState, + lifecycleState, + lifecycleDetails, + vmClusterCount, + ocid, + ociUrl, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExascaleDBStorageVaultProperties)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDBStorageVaultProperties 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 DeserializeExascaleDBStorageVaultProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDBStorageVaultProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultProperties.cs new file mode 100644 index 000000000000..0969e7b2b3fd --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDBStorageVaultProperties.cs @@ -0,0 +1,133 @@ +// 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.OracleDatabase.Models +{ + /// ExascaleDbStorageVault resource model. + public partial class ExascaleDBStorageVaultProperties + { + /// + /// 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 user-friendly name for the Exadata Database Storage Vault. The name does not need to be unique. + /// Create exadata Database Storage Details. + /// or is null. + public ExascaleDBStorageVaultProperties(string displayName, ExascaleDBStorageInputDetails highCapacityDatabaseStorageInput) + { + Argument.AssertNotNull(displayName, nameof(displayName)); + Argument.AssertNotNull(highCapacityDatabaseStorageInput, nameof(highCapacityDatabaseStorageInput)); + + DisplayName = displayName; + HighCapacityDatabaseStorageInput = highCapacityDatabaseStorageInput; + } + + /// Initializes a new instance of . + /// The size of additional Flash Cache in percentage of High Capacity database storage. + /// Exadata Database Storage Vault description. + /// The user-friendly name for the Exadata Database Storage Vault. The name does not need to be unique. + /// Create exadata Database Storage Details. + /// Response exadata Database Storage Details. + /// The time zone that you want to use for the Exadata Database Storage Vault. + /// Exadata Database Storage Vault provisioning state. + /// Exadata Database Storage Vault lifecycle state. + /// Additional information about the current lifecycle state. + /// The number of Exadata VM clusters used the Exadata Database Storage Vault. + /// The OCID of the Exadata Database Storage Vault. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Keeps track of any properties unknown to the library. + internal ExascaleDBStorageVaultProperties(int? additionalFlashCacheInPercent, string description, string displayName, ExascaleDBStorageInputDetails highCapacityDatabaseStorageInput, ExascaleDBStorageDetails highCapacityDatabaseStorage, string timeZone, OracleDatabaseProvisioningState? provisioningState, ExascaleDBStorageVaultLifecycleState? lifecycleState, string lifecycleDetails, int? vmClusterCount, ResourceIdentifier ocid, Uri ociUri, IDictionary serializedAdditionalRawData) + { + AdditionalFlashCacheInPercent = additionalFlashCacheInPercent; + Description = description; + DisplayName = displayName; + HighCapacityDatabaseStorageInput = highCapacityDatabaseStorageInput; + HighCapacityDatabaseStorage = highCapacityDatabaseStorage; + TimeZone = timeZone; + ProvisioningState = provisioningState; + LifecycleState = lifecycleState; + LifecycleDetails = lifecycleDetails; + VmClusterCount = vmClusterCount; + Ocid = ocid; + OciUri = ociUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExascaleDBStorageVaultProperties() + { + } + + /// The size of additional Flash Cache in percentage of High Capacity database storage. + public int? AdditionalFlashCacheInPercent { get; set; } + /// Exadata Database Storage Vault description. + public string Description { get; set; } + /// The user-friendly name for the Exadata Database Storage Vault. The name does not need to be unique. + public string DisplayName { get; set; } + /// Create exadata Database Storage Details. + internal ExascaleDBStorageInputDetails HighCapacityDatabaseStorageInput { get; set; } + /// Total Capacity. + public int? HighCapacityDatabaseStorageInputTotalSizeInGbs + { + get => HighCapacityDatabaseStorageInput is null ? default(int?) : HighCapacityDatabaseStorageInput.TotalSizeInGbs; + set + { + HighCapacityDatabaseStorageInput = value.HasValue ? new ExascaleDBStorageInputDetails(value.Value) : null; + } + } + + /// Response exadata Database Storage Details. + public ExascaleDBStorageDetails HighCapacityDatabaseStorage { get; } + /// The time zone that you want to use for the Exadata Database Storage Vault. + public string TimeZone { get; set; } + /// Exadata Database Storage Vault provisioning state. + public OracleDatabaseProvisioningState? ProvisioningState { get; } + /// Exadata Database Storage Vault lifecycle state. + public ExascaleDBStorageVaultLifecycleState? LifecycleState { get; } + /// Additional information about the current lifecycle state. + public string LifecycleDetails { get; } + /// The number of Exadata VM clusters used the Exadata Database Storage Vault. + public int? VmClusterCount { get; } + /// The OCID of the Exadata Database Storage Vault. + public ResourceIdentifier Ocid { get; } + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + public Uri OciUri { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.Serialization.cs new file mode 100644 index 000000000000..2e16921c5fc5 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.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.OracleDatabase.Models +{ + public partial class FileSystemConfigurationDetails : 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(FileSystemConfigurationDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MountPoint)) + { + writer.WritePropertyName("mountPoint"u8); + writer.WriteStringValue(MountPoint); + } + if (Optional.IsDefined(FileSystemSizeGb)) + { + writer.WritePropertyName("fileSystemSizeGb"u8); + writer.WriteNumberValue(FileSystemSizeGb.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 + } + } + } + + FileSystemConfigurationDetails 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(FileSystemConfigurationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFileSystemConfigurationDetails(document.RootElement, options); + } + + internal static FileSystemConfigurationDetails DeserializeFileSystemConfigurationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string mountPoint = default; + int? fileSystemSizeGb = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mountPoint"u8)) + { + mountPoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("fileSystemSizeGb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fileSystemSizeGb = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FileSystemConfigurationDetails(mountPoint, fileSystemSizeGb, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FileSystemConfigurationDetails)} does not support writing '{options.Format}' format."); + } + } + + FileSystemConfigurationDetails 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 DeserializeFileSystemConfigurationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FileSystemConfigurationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.cs new file mode 100644 index 000000000000..260492d0d899 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.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.OracleDatabase.Models +{ + /// File configuration options. + public partial class FileSystemConfigurationDetails + { + /// + /// 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 FileSystemConfigurationDetails() + { + } + + /// Initializes a new instance of . + /// Mount path. + /// Size of the VM. + /// Keeps track of any properties unknown to the library. + internal FileSystemConfigurationDetails(string mountPoint, int? fileSystemSizeGb, IDictionary serializedAdditionalRawData) + { + MountPoint = mountPoint; + FileSystemSizeGb = fileSystemSizeGb; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Mount path. + public string MountPoint { get; set; } + /// Size of the VM. + public int? FileSystemSizeGb { get; set; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.Serialization.cs new file mode 100644 index 000000000000..ca02f1e1ecae --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.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.OracleDatabase.Models +{ + internal partial class FlexComponentListResult : 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(FlexComponentListResult)} 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 + } + } + } + + FlexComponentListResult 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(FlexComponentListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFlexComponentListResult(document.RootElement, options); + } + + internal static FlexComponentListResult DeserializeFlexComponentListResult(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(FlexComponentData.DeserializeFlexComponentData(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 FlexComponentListResult(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); + default: + throw new FormatException($"The model {nameof(FlexComponentListResult)} does not support writing '{options.Format}' format."); + } + } + + FlexComponentListResult 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 DeserializeFlexComponentListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FlexComponentListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.cs new file mode 100644 index 000000000000..35dd7659fe1f --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.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.OracleDatabase.Models +{ + /// The response of a FlexComponent list operation. + internal partial class FlexComponentListResult + { + /// + /// 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 FlexComponent items on this page. + /// is null. + internal FlexComponentListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FlexComponent items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FlexComponentListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FlexComponentListResult() + { + } + + /// The FlexComponent items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.Serialization.cs new file mode 100644 index 000000000000..df2823c68239 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.Serialization.cs @@ -0,0 +1,267 @@ +// 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.OracleDatabase.Models +{ + public partial class FlexComponentProperties : 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(FlexComponentProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(MinimumCoreCount)) + { + writer.WritePropertyName("minimumCoreCount"u8); + writer.WriteNumberValue(MinimumCoreCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(AvailableCoreCount)) + { + writer.WritePropertyName("availableCoreCount"u8); + writer.WriteNumberValue(AvailableCoreCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(AvailableDBStorageInGbs)) + { + writer.WritePropertyName("availableDbStorageInGbs"u8); + writer.WriteNumberValue(AvailableDBStorageInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(RuntimeMinimumCoreCount)) + { + writer.WritePropertyName("runtimeMinimumCoreCount"u8); + writer.WriteNumberValue(RuntimeMinimumCoreCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(Shape)) + { + writer.WritePropertyName("shape"u8); + writer.WriteStringValue(Shape); + } + if (options.Format != "W" && Optional.IsDefined(AvailableMemoryInGbs)) + { + writer.WritePropertyName("availableMemoryInGbs"u8); + writer.WriteNumberValue(AvailableMemoryInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(AvailableLocalStorageInGbs)) + { + writer.WritePropertyName("availableLocalStorageInGbs"u8); + writer.WriteNumberValue(AvailableLocalStorageInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(ComputeModel)) + { + writer.WritePropertyName("computeModel"u8); + writer.WriteStringValue(ComputeModel); + } + if (options.Format != "W" && Optional.IsDefined(HardwareType)) + { + writer.WritePropertyName("hardwareType"u8); + writer.WriteStringValue(HardwareType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(DescriptionSummary)) + { + writer.WritePropertyName("descriptionSummary"u8); + writer.WriteStringValue(DescriptionSummary); + } + 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 + } + } + } + + FlexComponentProperties 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(FlexComponentProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFlexComponentProperties(document.RootElement, options); + } + + internal static FlexComponentProperties DeserializeFlexComponentProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? minimumCoreCount = default; + int? availableCoreCount = default; + int? availableDBStorageInGbs = default; + int? runtimeMinimumCoreCount = default; + string shape = default; + int? availableMemoryInGbs = default; + int? availableLocalStorageInGbs = default; + string computeModel = default; + HardwareType? hardwareType = default; + string descriptionSummary = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("minimumCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minimumCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("availableCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("availableDbStorageInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableDBStorageInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("runtimeMinimumCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + runtimeMinimumCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("shape"u8)) + { + shape = property.Value.GetString(); + continue; + } + if (property.NameEquals("availableMemoryInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableMemoryInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("availableLocalStorageInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableLocalStorageInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("computeModel"u8)) + { + computeModel = property.Value.GetString(); + continue; + } + if (property.NameEquals("hardwareType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hardwareType = new HardwareType(property.Value.GetString()); + continue; + } + if (property.NameEquals("descriptionSummary"u8)) + { + descriptionSummary = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FlexComponentProperties( + minimumCoreCount, + availableCoreCount, + availableDBStorageInGbs, + runtimeMinimumCoreCount, + shape, + availableMemoryInGbs, + availableLocalStorageInGbs, + computeModel, + hardwareType, + descriptionSummary, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FlexComponentProperties)} does not support writing '{options.Format}' format."); + } + } + + FlexComponentProperties 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 DeserializeFlexComponentProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FlexComponentProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.cs new file mode 100644 index 000000000000..1622cef77a8d --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.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.OracleDatabase.Models +{ + /// FlexComponent resource model. + public partial class FlexComponentProperties + { + /// + /// 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 FlexComponentProperties() + { + } + + /// Initializes a new instance of . + /// The minimum number of CPU cores that can be enabled on the DB Server for this Flex Component. + /// The maximum number of CPU cores that can be enabled on the DB Server for this Flex Component. + /// The maximum storage that can be enabled on the Storage Server for this Flex Component. + /// The runtime minimum number of CPU cores that can be enabled for this Flex Component. + /// The name of the DB system shape for this Flex Component. + /// The maximum memory size that can be enabled on the DB Server for this Flex Component. + /// The maximum local storage that can be enabled on the DB Server for this Flex Component. + /// The compute model of the DB Server for this Flex Component. + /// The hardware type of the DB (Compute) or Storage (Cell) Server for this Flex Component. + /// The description summary for this Flex Component. + /// Keeps track of any properties unknown to the library. + internal FlexComponentProperties(int? minimumCoreCount, int? availableCoreCount, int? availableDBStorageInGbs, int? runtimeMinimumCoreCount, string shape, int? availableMemoryInGbs, int? availableLocalStorageInGbs, string computeModel, HardwareType? hardwareType, string descriptionSummary, IDictionary serializedAdditionalRawData) + { + MinimumCoreCount = minimumCoreCount; + AvailableCoreCount = availableCoreCount; + AvailableDBStorageInGbs = availableDBStorageInGbs; + RuntimeMinimumCoreCount = runtimeMinimumCoreCount; + Shape = shape; + AvailableMemoryInGbs = availableMemoryInGbs; + AvailableLocalStorageInGbs = availableLocalStorageInGbs; + ComputeModel = computeModel; + HardwareType = hardwareType; + DescriptionSummary = descriptionSummary; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The minimum number of CPU cores that can be enabled on the DB Server for this Flex Component. + public int? MinimumCoreCount { get; } + /// The maximum number of CPU cores that can be enabled on the DB Server for this Flex Component. + public int? AvailableCoreCount { get; } + /// The maximum storage that can be enabled on the Storage Server for this Flex Component. + public int? AvailableDBStorageInGbs { get; } + /// The runtime minimum number of CPU cores that can be enabled for this Flex Component. + public int? RuntimeMinimumCoreCount { get; } + /// The name of the DB system shape for this Flex Component. + public string Shape { get; } + /// The maximum memory size that can be enabled on the DB Server for this Flex Component. + public int? AvailableMemoryInGbs { get; } + /// The maximum local storage that can be enabled on the DB Server for this Flex Component. + public int? AvailableLocalStorageInGbs { get; } + /// The compute model of the DB Server for this Flex Component. + public string ComputeModel { get; } + /// The hardware type of the DB (Compute) or Storage (Cell) Server for this Flex Component. + public HardwareType? HardwareType { get; } + /// The description summary for this Flex Component. + public string DescriptionSummary { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.Serialization.cs new file mode 100644 index 000000000000..988ccb84a18b --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.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.OracleDatabase.Models +{ + internal partial class GiMinorVersionListResult : 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(GiMinorVersionListResult)} 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 + } + } + } + + GiMinorVersionListResult 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(GiMinorVersionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGiMinorVersionListResult(document.RootElement, options); + } + + internal static GiMinorVersionListResult DeserializeGiMinorVersionListResult(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(GiMinorVersionData.DeserializeGiMinorVersionData(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 GiMinorVersionListResult(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); + default: + throw new FormatException($"The model {nameof(GiMinorVersionListResult)} does not support writing '{options.Format}' format."); + } + } + + GiMinorVersionListResult 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 DeserializeGiMinorVersionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GiMinorVersionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.cs new file mode 100644 index 000000000000..6f40be5d6c95 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.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.OracleDatabase.Models +{ + /// The response of a GiMinorVersion list operation. + internal partial class GiMinorVersionListResult + { + /// + /// 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 GiMinorVersion items on this page. + /// is null. + internal GiMinorVersionListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The GiMinorVersion items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal GiMinorVersionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GiMinorVersionListResult() + { + } + + /// The GiMinorVersion items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.Serialization.cs new file mode 100644 index 000000000000..0d86ab0feb8f --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.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.OracleDatabase.Models +{ + public partial class GiMinorVersionProperties : 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(GiMinorVersionProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + if (Optional.IsDefined(GridImageOcid)) + { + writer.WritePropertyName("gridImageOcid"u8); + writer.WriteStringValue(GridImageOcid); + } + 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 + } + } + } + + GiMinorVersionProperties 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(GiMinorVersionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGiMinorVersionProperties(document.RootElement, options); + } + + internal static GiMinorVersionProperties DeserializeGiMinorVersionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string version = default; + ResourceIdentifier gridImageOcid = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("gridImageOcid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gridImageOcid = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GiMinorVersionProperties(version, gridImageOcid, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GiMinorVersionProperties)} does not support writing '{options.Format}' format."); + } + } + + GiMinorVersionProperties 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 DeserializeGiMinorVersionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GiMinorVersionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.cs new file mode 100644 index 000000000000..71a711c4b919 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.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; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// The Oracle Grid Infrastructure (GI) minor version properties. + public partial class GiMinorVersionProperties + { + /// + /// 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 . + /// A valid Oracle Grid Infrastructure (GI) software version. + /// is null. + public GiMinorVersionProperties(string version) + { + Argument.AssertNotNull(version, nameof(version)); + + Version = version; + } + + /// Initializes a new instance of . + /// A valid Oracle Grid Infrastructure (GI) software version. + /// Grid Infrastructure Image Id. + /// Keeps track of any properties unknown to the library. + internal GiMinorVersionProperties(string version, ResourceIdentifier gridImageOcid, IDictionary serializedAdditionalRawData) + { + Version = version; + GridImageOcid = gridImageOcid; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GiMinorVersionProperties() + { + } + + /// A valid Oracle Grid Infrastructure (GI) software version. + public string Version { get; set; } + /// Grid Infrastructure Image Id. + public ResourceIdentifier GridImageOcid { get; set; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GridImageType.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GridImageType.cs new file mode 100644 index 000000000000..9e8c86a38d34 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GridImageType.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.OracleDatabase.Models +{ + /// GridImageType enum. + public readonly partial struct GridImageType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public GridImageType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReleaseUpdateValue = "ReleaseUpdate"; + private const string CustomImageValue = "CustomImage"; + + /// Release update. + public static GridImageType ReleaseUpdate { get; } = new GridImageType(ReleaseUpdateValue); + /// Custom image. + public static GridImageType CustomImage { get; } = new GridImageType(CustomImageValue); + /// Determines if two values are the same. + public static bool operator ==(GridImageType left, GridImageType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(GridImageType left, GridImageType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator GridImageType(string value) => new GridImageType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is GridImageType other && Equals(other); + /// + public bool Equals(GridImageType 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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/HardwareType.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/HardwareType.cs new file mode 100644 index 000000000000..140261dbd4b7 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/HardwareType.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.OracleDatabase.Models +{ + /// Hardware Type enum. + public readonly partial struct HardwareType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HardwareType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ComputeValue = "COMPUTE"; + private const string CellValue = "CELL"; + + /// Hardware type is Database Server. + public static HardwareType Compute { get; } = new HardwareType(ComputeValue); + /// Hardware type is Storage Server. + public static HardwareType Cell { get; } = new HardwareType(CellValue); + /// Determines if two values are the same. + public static bool operator ==(HardwareType left, HardwareType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HardwareType left, HardwareType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator HardwareType(string value) => new HardwareType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HardwareType other && Equals(other); + /// + public bool Equals(HardwareType 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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBServerProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBServerProperties.Serialization.cs index 4b70e821675a..19b22700fb52 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBServerProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBServerProperties.Serialization.cs @@ -174,6 +174,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(ComputeModel)) + { + writer.WritePropertyName("computeModel"u8); + writer.WriteStringValue(ComputeModel.Value.ToString()); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -231,6 +236,7 @@ internal static OracleDBServerProperties DeserializeOracleDBServerProperties(Jso string shape = default; DateTimeOffset? timeCreated = default; OracleDatabaseResourceProvisioningState? provisioningState = default; + AutonomousDatabaseComputeModel? computeModel = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -451,6 +457,15 @@ internal static OracleDBServerProperties DeserializeOracleDBServerProperties(Jso provisioningState = new OracleDatabaseResourceProvisioningState(property.Value.GetString()); continue; } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new AutonomousDatabaseComputeModel(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -478,6 +493,7 @@ internal static OracleDBServerProperties DeserializeOracleDBServerProperties(Jso shape, timeCreated, provisioningState, + computeModel, serializedAdditionalRawData); } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBServerProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBServerProperties.cs index 5474e675f4e7..036768564c64 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBServerProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBServerProperties.cs @@ -76,8 +76,9 @@ public OracleDBServerProperties() /// The shape of the Db server. The shape determines the amount of CPU, storage, and memory resources available. /// The date and time that the Db Server was created. /// Azure resource provisioning state. + /// The compute model of the Exadata Infrastructure. /// Keeps track of any properties unknown to the library. - internal OracleDBServerProperties(ResourceIdentifier ocid, string displayName, ResourceIdentifier compartmentId, ResourceIdentifier exadataInfrastructureId, int? cpuCoreCount, DBServerPatchingDetails dbServerPatchingDetails, int? maxMemoryInGbs, int? dbNodeStorageSizeInGbs, IReadOnlyList vmClusterIds, IReadOnlyList dbNodeIds, string lifecycleDetails, DBServerProvisioningState? lifecycleState, int? maxCpuCount, IReadOnlyList autonomousVmClusterIds, IReadOnlyList autonomousVirtualMachineIds, int? maxDBNodeStorageInGbs, int? memorySizeInGbs, string shape, DateTimeOffset? createdOn, OracleDatabaseResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + internal OracleDBServerProperties(ResourceIdentifier ocid, string displayName, ResourceIdentifier compartmentId, ResourceIdentifier exadataInfrastructureId, int? cpuCoreCount, DBServerPatchingDetails dbServerPatchingDetails, int? maxMemoryInGbs, int? dbNodeStorageSizeInGbs, IReadOnlyList vmClusterIds, IReadOnlyList dbNodeIds, string lifecycleDetails, DBServerProvisioningState? lifecycleState, int? maxCpuCount, IReadOnlyList autonomousVmClusterIds, IReadOnlyList autonomousVirtualMachineIds, int? maxDBNodeStorageInGbs, int? memorySizeInGbs, string shape, DateTimeOffset? createdOn, OracleDatabaseResourceProvisioningState? provisioningState, AutonomousDatabaseComputeModel? computeModel, IDictionary serializedAdditionalRawData) { Ocid = ocid; DisplayName = displayName; @@ -99,6 +100,7 @@ internal OracleDBServerProperties(ResourceIdentifier ocid, string displayName, R Shape = shape; CreatedOn = createdOn; ProvisioningState = provisioningState; + ComputeModel = computeModel; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -142,5 +144,7 @@ internal OracleDBServerProperties(ResourceIdentifier ocid, string displayName, R public DateTimeOffset? CreatedOn { get; } /// Azure resource provisioning state. public OracleDatabaseResourceProvisioningState? ProvisioningState { get; } + /// The compute model of the Exadata Infrastructure. + public AutonomousDatabaseComputeModel? ComputeModel { get; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBSystemShapeProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBSystemShapeProperties.Serialization.cs index c09230dbc38e..b745e8b981f1 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBSystemShapeProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBSystemShapeProperties.Serialization.cs @@ -34,106 +34,120 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(OracleDBSystemShapeProperties)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(ShapeFamily)) + if (Optional.IsDefined(ShapeFamily)) { writer.WritePropertyName("shapeFamily"u8); writer.WriteStringValue(ShapeFamily); } - if (options.Format != "W") - { - writer.WritePropertyName("availableCoreCount"u8); - writer.WriteNumberValue(AvailableCoreCount); - } - if (options.Format != "W" && Optional.IsDefined(MinimumCoreCount)) + writer.WritePropertyName("shapeName"u8); + writer.WriteStringValue(ShapeName); + writer.WritePropertyName("availableCoreCount"u8); + writer.WriteNumberValue(AvailableCoreCount); + if (Optional.IsDefined(MinimumCoreCount)) { writer.WritePropertyName("minimumCoreCount"u8); writer.WriteNumberValue(MinimumCoreCount.Value); } - if (options.Format != "W" && Optional.IsDefined(RuntimeMinimumCoreCount)) + if (Optional.IsDefined(RuntimeMinimumCoreCount)) { writer.WritePropertyName("runtimeMinimumCoreCount"u8); writer.WriteNumberValue(RuntimeMinimumCoreCount.Value); } - if (options.Format != "W" && Optional.IsDefined(CoreCountIncrement)) + if (Optional.IsDefined(CoreCountIncrement)) { writer.WritePropertyName("coreCountIncrement"u8); writer.WriteNumberValue(CoreCountIncrement.Value); } - if (options.Format != "W" && Optional.IsDefined(MinStorageCount)) + if (Optional.IsDefined(MinStorageCount)) { writer.WritePropertyName("minStorageCount"u8); writer.WriteNumberValue(MinStorageCount.Value); } - if (options.Format != "W" && Optional.IsDefined(MaxStorageCount)) + if (Optional.IsDefined(MaxStorageCount)) { writer.WritePropertyName("maxStorageCount"u8); writer.WriteNumberValue(MaxStorageCount.Value); } - if (options.Format != "W" && Optional.IsDefined(AvailableDataStoragePerServerInTbs)) + if (Optional.IsDefined(AvailableDataStoragePerServerInTbs)) { writer.WritePropertyName("availableDataStoragePerServerInTbs"u8); writer.WriteNumberValue(AvailableDataStoragePerServerInTbs.Value); } - if (options.Format != "W" && Optional.IsDefined(AvailableMemoryPerNodeInGbs)) + if (Optional.IsDefined(AvailableMemoryPerNodeInGbs)) { writer.WritePropertyName("availableMemoryPerNodeInGbs"u8); writer.WriteNumberValue(AvailableMemoryPerNodeInGbs.Value); } - if (options.Format != "W" && Optional.IsDefined(AvailableDBNodePerNodeInGbs)) + if (Optional.IsDefined(AvailableDBNodePerNodeInGbs)) { writer.WritePropertyName("availableDbNodePerNodeInGbs"u8); writer.WriteNumberValue(AvailableDBNodePerNodeInGbs.Value); } - if (options.Format != "W" && Optional.IsDefined(MinCoreCountPerNode)) + if (Optional.IsDefined(MinCoreCountPerNode)) { writer.WritePropertyName("minCoreCountPerNode"u8); writer.WriteNumberValue(MinCoreCountPerNode.Value); } - if (options.Format != "W" && Optional.IsDefined(AvailableMemoryInGbs)) + if (Optional.IsDefined(AvailableMemoryInGbs)) { writer.WritePropertyName("availableMemoryInGbs"u8); writer.WriteNumberValue(AvailableMemoryInGbs.Value); } - if (options.Format != "W" && Optional.IsDefined(MinMemoryPerNodeInGbs)) + if (Optional.IsDefined(MinMemoryPerNodeInGbs)) { writer.WritePropertyName("minMemoryPerNodeInGbs"u8); writer.WriteNumberValue(MinMemoryPerNodeInGbs.Value); } - if (options.Format != "W" && Optional.IsDefined(AvailableDBNodeStorageInGbs)) + if (Optional.IsDefined(AvailableDBNodeStorageInGbs)) { writer.WritePropertyName("availableDbNodeStorageInGbs"u8); writer.WriteNumberValue(AvailableDBNodeStorageInGbs.Value); } - if (options.Format != "W" && Optional.IsDefined(MinDBNodeStoragePerNodeInGbs)) + if (Optional.IsDefined(MinDBNodeStoragePerNodeInGbs)) { writer.WritePropertyName("minDbNodeStoragePerNodeInGbs"u8); writer.WriteNumberValue(MinDBNodeStoragePerNodeInGbs.Value); } - if (options.Format != "W" && Optional.IsDefined(AvailableDataStorageInTbs)) + if (Optional.IsDefined(AvailableDataStorageInTbs)) { writer.WritePropertyName("availableDataStorageInTbs"u8); writer.WriteNumberValue(AvailableDataStorageInTbs.Value); } - if (options.Format != "W" && Optional.IsDefined(MinDataStorageInTbs)) + if (Optional.IsDefined(MinDataStorageInTbs)) { writer.WritePropertyName("minDataStorageInTbs"u8); writer.WriteNumberValue(MinDataStorageInTbs.Value); } - if (options.Format != "W" && Optional.IsDefined(MinimumNodeCount)) + if (Optional.IsDefined(MinimumNodeCount)) { writer.WritePropertyName("minimumNodeCount"u8); writer.WriteNumberValue(MinimumNodeCount.Value); } - if (options.Format != "W" && Optional.IsDefined(MaximumNodeCount)) + if (Optional.IsDefined(MaximumNodeCount)) { writer.WritePropertyName("maximumNodeCount"u8); writer.WriteNumberValue(MaximumNodeCount.Value); } - if (options.Format != "W" && Optional.IsDefined(AvailableCoreCountPerNode)) + if (Optional.IsDefined(AvailableCoreCountPerNode)) { writer.WritePropertyName("availableCoreCountPerNode"u8); writer.WriteNumberValue(AvailableCoreCountPerNode.Value); } + if (Optional.IsDefined(ComputeModel)) + { + writer.WritePropertyName("computeModel"u8); + writer.WriteStringValue(ComputeModel.Value.ToString()); + } + if (Optional.IsDefined(AreServerTypesSupported)) + { + writer.WritePropertyName("areServerTypesSupported"u8); + writer.WriteBooleanValue(AreServerTypesSupported.Value); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -172,6 +186,7 @@ internal static OracleDBSystemShapeProperties DeserializeOracleDBSystemShapeProp return null; } string shapeFamily = default; + string shapeName = default; int availableCoreCount = default; int? minimumCoreCount = default; int? runtimeMinimumCoreCount = default; @@ -191,6 +206,9 @@ internal static OracleDBSystemShapeProperties DeserializeOracleDBSystemShapeProp int? minimumNodeCount = default; int? maximumNodeCount = default; int? availableCoreCountPerNode = default; + AutonomousDatabaseComputeModel? computeModel = default; + bool? areServerTypesSupported = default; + string displayName = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -200,6 +218,11 @@ internal static OracleDBSystemShapeProperties DeserializeOracleDBSystemShapeProp shapeFamily = property.Value.GetString(); continue; } + if (property.NameEquals("shapeName"u8)) + { + shapeName = property.Value.GetString(); + continue; + } if (property.NameEquals("availableCoreCount"u8)) { availableCoreCount = property.Value.GetInt32(); @@ -367,6 +390,29 @@ internal static OracleDBSystemShapeProperties DeserializeOracleDBSystemShapeProp availableCoreCountPerNode = property.Value.GetInt32(); continue; } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new AutonomousDatabaseComputeModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("areServerTypesSupported"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + areServerTypesSupported = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -375,6 +421,7 @@ internal static OracleDBSystemShapeProperties DeserializeOracleDBSystemShapeProp serializedAdditionalRawData = rawDataDictionary; return new OracleDBSystemShapeProperties( shapeFamily, + shapeName, availableCoreCount, minimumCoreCount, runtimeMinimumCoreCount, @@ -394,6 +441,9 @@ internal static OracleDBSystemShapeProperties DeserializeOracleDBSystemShapeProp minimumNodeCount, maximumNodeCount, availableCoreCountPerNode, + computeModel, + areServerTypesSupported, + displayName, serializedAdditionalRawData); } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBSystemShapeProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBSystemShapeProperties.cs index 74ad3267ecf9..8bce83feb76e 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBSystemShapeProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDBSystemShapeProperties.cs @@ -46,14 +46,20 @@ public partial class OracleDBSystemShapeProperties private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . + /// The shape used for the DB system. /// The maximum number of CPU cores that can be enabled on the DB system for this shape. - public OracleDBSystemShapeProperties(int availableCoreCount) + /// is null. + public OracleDBSystemShapeProperties(string shapeName, int availableCoreCount) { + Argument.AssertNotNull(shapeName, nameof(shapeName)); + + ShapeName = shapeName; AvailableCoreCount = availableCoreCount; } /// Initializes a new instance of . /// The family of the shape used for the DB system. + /// The shape used for the DB system. /// The maximum number of CPU cores that can be enabled on the DB system for this shape. /// The minimum number of CPU cores that can be enabled on the DB system for this shape. /// The runtime minimum number of CPU cores that can be enabled on the DB system for this shape. @@ -73,10 +79,14 @@ public OracleDBSystemShapeProperties(int availableCoreCount) /// The minimum number of database nodes available for this shape. /// The maximum number of database nodes available for this shape. /// The maximum number of CPU cores per database node that can be enabled for this shape. Only applicable to the flex Exadata shape and ExaCC Elastic shapes. + /// The compute model of the Exadata Infrastructure. + /// Indicates if the shape supports database and storage server types. + /// The display name of the shape used for the DB system. /// Keeps track of any properties unknown to the library. - internal OracleDBSystemShapeProperties(string shapeFamily, int availableCoreCount, int? minimumCoreCount, int? runtimeMinimumCoreCount, int? coreCountIncrement, int? minStorageCount, int? maxStorageCount, double? availableDataStoragePerServerInTbs, int? availableMemoryPerNodeInGbs, int? availableDBNodePerNodeInGbs, int? minCoreCountPerNode, int? availableMemoryInGbs, int? minMemoryPerNodeInGbs, int? availableDBNodeStorageInGbs, int? minDBNodeStoragePerNodeInGbs, int? availableDataStorageInTbs, int? minDataStorageInTbs, int? minimumNodeCount, int? maximumNodeCount, int? availableCoreCountPerNode, IDictionary serializedAdditionalRawData) + internal OracleDBSystemShapeProperties(string shapeFamily, string shapeName, int availableCoreCount, int? minimumCoreCount, int? runtimeMinimumCoreCount, int? coreCountIncrement, int? minStorageCount, int? maxStorageCount, double? availableDataStoragePerServerInTbs, int? availableMemoryPerNodeInGbs, int? availableDBNodePerNodeInGbs, int? minCoreCountPerNode, int? availableMemoryInGbs, int? minMemoryPerNodeInGbs, int? availableDBNodeStorageInGbs, int? minDBNodeStoragePerNodeInGbs, int? availableDataStorageInTbs, int? minDataStorageInTbs, int? minimumNodeCount, int? maximumNodeCount, int? availableCoreCountPerNode, AutonomousDatabaseComputeModel? computeModel, bool? areServerTypesSupported, string displayName, IDictionary serializedAdditionalRawData) { ShapeFamily = shapeFamily; + ShapeName = shapeName; AvailableCoreCount = availableCoreCount; MinimumCoreCount = minimumCoreCount; RuntimeMinimumCoreCount = runtimeMinimumCoreCount; @@ -96,6 +106,9 @@ internal OracleDBSystemShapeProperties(string shapeFamily, int availableCoreCoun MinimumNodeCount = minimumNodeCount; MaximumNodeCount = maximumNodeCount; AvailableCoreCountPerNode = availableCoreCountPerNode; + ComputeModel = computeModel; + AreServerTypesSupported = areServerTypesSupported; + DisplayName = displayName; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -105,44 +118,52 @@ internal OracleDBSystemShapeProperties() } /// The family of the shape used for the DB system. - public string ShapeFamily { get; } + public string ShapeFamily { get; set; } + /// The shape used for the DB system. + public string ShapeName { get; set; } /// The maximum number of CPU cores that can be enabled on the DB system for this shape. - public int AvailableCoreCount { get; } + public int AvailableCoreCount { get; set; } /// The minimum number of CPU cores that can be enabled on the DB system for this shape. - public int? MinimumCoreCount { get; } + public int? MinimumCoreCount { get; set; } /// The runtime minimum number of CPU cores that can be enabled on the DB system for this shape. - public int? RuntimeMinimumCoreCount { get; } + public int? RuntimeMinimumCoreCount { get; set; } /// The discrete number by which the CPU core count for this shape can be increased or decreased. - public int? CoreCountIncrement { get; } + public int? CoreCountIncrement { get; set; } /// The minimum number of Exadata storage servers available for the Exadata infrastructure. - public int? MinStorageCount { get; } + public int? MinStorageCount { get; set; } /// The maximum number of Exadata storage servers available for the Exadata infrastructure. - public int? MaxStorageCount { get; } + public int? MaxStorageCount { get; set; } /// The maximum data storage available per storage server for this shape. Only applicable to ExaCC Elastic shapes. - public double? AvailableDataStoragePerServerInTbs { get; } + public double? AvailableDataStoragePerServerInTbs { get; set; } /// The maximum memory available per database node for this shape. Only applicable to ExaCC Elastic shapes. - public int? AvailableMemoryPerNodeInGbs { get; } + public int? AvailableMemoryPerNodeInGbs { get; set; } /// The maximum Db Node storage available per database node for this shape. Only applicable to ExaCC Elastic shapes. - public int? AvailableDBNodePerNodeInGbs { get; } + public int? AvailableDBNodePerNodeInGbs { get; set; } /// The minimum number of CPU cores that can be enabled per node for this shape. - public int? MinCoreCountPerNode { get; } + public int? MinCoreCountPerNode { get; set; } /// The maximum memory that can be enabled for this shape. - public int? AvailableMemoryInGbs { get; } + public int? AvailableMemoryInGbs { get; set; } /// The minimum memory that need be allocated per node for this shape. - public int? MinMemoryPerNodeInGbs { get; } + public int? MinMemoryPerNodeInGbs { get; set; } /// The maximum Db Node storage that can be enabled for this shape. - public int? AvailableDBNodeStorageInGbs { get; } + public int? AvailableDBNodeStorageInGbs { get; set; } /// The minimum Db Node storage that need be allocated per node for this shape. - public int? MinDBNodeStoragePerNodeInGbs { get; } + public int? MinDBNodeStoragePerNodeInGbs { get; set; } /// The maximum DATA storage that can be enabled for this shape. - public int? AvailableDataStorageInTbs { get; } + public int? AvailableDataStorageInTbs { get; set; } /// The minimum data storage that need be allocated for this shape. - public int? MinDataStorageInTbs { get; } + public int? MinDataStorageInTbs { get; set; } /// The minimum number of database nodes available for this shape. - public int? MinimumNodeCount { get; } + public int? MinimumNodeCount { get; set; } /// The maximum number of database nodes available for this shape. - public int? MaximumNodeCount { get; } + public int? MaximumNodeCount { get; set; } /// The maximum number of CPU cores per database node that can be enabled for this shape. Only applicable to the flex Exadata shape and ExaCC Elastic shapes. - public int? AvailableCoreCountPerNode { get; } + public int? AvailableCoreCountPerNode { get; set; } + /// The compute model of the Exadata Infrastructure. + public AutonomousDatabaseComputeModel? ComputeModel { get; set; } + /// Indicates if the shape supports database and storage server types. + public bool? AreServerTypesSupported { get; set; } + /// The display name of the shape used for the DB system. + public string DisplayName { get; set; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDataBaseType.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDataBaseType.cs index fca1005cf73f..c5a412dda8f1 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDataBaseType.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDataBaseType.cs @@ -24,11 +24,17 @@ public OracleDataBaseType(string value) private const string RegularValue = "Regular"; private const string CloneValue = "Clone"; + private const string CloneFromBackupTimestampValue = "CloneFromBackupTimestamp"; + private const string CrossRegionDisasterRecoveryValue = "CrossRegionDisasterRecovery"; /// Regular DB. public static OracleDataBaseType Regular { get; } = new OracleDataBaseType(RegularValue); /// Clone DB. public static OracleDataBaseType Clone { get; } = new OracleDataBaseType(CloneValue); + /// Clone DB from backup timestamp. + public static OracleDataBaseType CloneFromBackupTimestamp { get; } = new OracleDataBaseType(CloneFromBackupTimestampValue); + /// Cross Region Disaster Recovery. + public static OracleDataBaseType CrossRegionDisasterRecovery { get; } = new OracleDataBaseType(CrossRegionDisasterRecoveryValue); /// Determines if two values are the same. public static bool operator ==(OracleDataBaseType left, OracleDataBaseType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateViewProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateViewProperties.Serialization.cs index ff833855907d..f5f341d87f7c 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateViewProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateViewProperties.Serialization.cs @@ -34,41 +34,20 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(OracleDnsPrivateViewProperties)} does not support writing '{format}' format."); } - if (options.Format != "W") - { - writer.WritePropertyName("ocid"u8); - writer.WriteStringValue(Ocid); - } - if (options.Format != "W" && Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - if (options.Format != "W") - { - writer.WritePropertyName("isProtected"u8); - writer.WriteBooleanValue(IsProtected); - } - if (options.Format != "W" && Optional.IsDefined(LifecycleState)) - { - writer.WritePropertyName("lifecycleState"u8); - writer.WriteStringValue(LifecycleState.Value.ToString()); - } - if (options.Format != "W") - { - writer.WritePropertyName("self"u8); - writer.WriteStringValue(Self); - } - if (options.Format != "W") - { - writer.WritePropertyName("timeCreated"u8); - writer.WriteStringValue(CreatedOn, "O"); - } - if (options.Format != "W") - { - writer.WritePropertyName("timeUpdated"u8); - writer.WriteStringValue(UpdatedOn, "O"); - } + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + writer.WritePropertyName("isProtected"u8); + writer.WriteBooleanValue(IsProtected); + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.ToString()); + writer.WritePropertyName("self"u8); + writer.WriteStringValue(Self); + writer.WritePropertyName("timeCreated"u8); + writer.WriteStringValue(CreatedOn, "O"); + writer.WritePropertyName("timeUpdated"u8); + writer.WriteStringValue(UpdatedOn, "O"); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -114,7 +93,7 @@ internal static OracleDnsPrivateViewProperties DeserializeOracleDnsPrivateViewPr ResourceIdentifier ocid = default; string displayName = default; bool isProtected = default; - DnsPrivateViewsLifecycleState? lifecycleState = default; + DnsPrivateViewsLifecycleState lifecycleState = default; string self = default; DateTimeOffset timeCreated = default; DateTimeOffset timeUpdated = default; @@ -140,10 +119,6 @@ internal static OracleDnsPrivateViewProperties DeserializeOracleDnsPrivateViewPr } if (property.NameEquals("lifecycleState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } lifecycleState = new DnsPrivateViewsLifecycleState(property.Value.GetString()); continue; } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateViewProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateViewProperties.cs index c8b26ebd44fd..e47e51026240 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateViewProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateViewProperties.cs @@ -48,14 +48,23 @@ public partial class OracleDnsPrivateViewProperties /// Initializes a new instance of . /// The OCID of the view. + /// The display name of the view resource. /// A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. + /// Views lifecycleState. /// The canonical absolute URL of the resource. /// views timeCreated. /// views timeCreated. - public OracleDnsPrivateViewProperties(ResourceIdentifier ocid, bool isProtected, string self, DateTimeOffset createdOn, DateTimeOffset updatedOn) + /// , or is null. + public OracleDnsPrivateViewProperties(ResourceIdentifier ocid, string displayName, bool isProtected, DnsPrivateViewsLifecycleState lifecycleState, string self, DateTimeOffset createdOn, DateTimeOffset updatedOn) { + Argument.AssertNotNull(ocid, nameof(ocid)); + Argument.AssertNotNull(displayName, nameof(displayName)); + Argument.AssertNotNull(self, nameof(self)); + Ocid = ocid; + DisplayName = displayName; IsProtected = isProtected; + LifecycleState = lifecycleState; Self = self; CreatedOn = createdOn; UpdatedOn = updatedOn; @@ -71,7 +80,7 @@ public OracleDnsPrivateViewProperties(ResourceIdentifier ocid, bool isProtected, /// views timeCreated. /// Azure resource provisioning state. /// Keeps track of any properties unknown to the library. - internal OracleDnsPrivateViewProperties(ResourceIdentifier ocid, string displayName, bool isProtected, DnsPrivateViewsLifecycleState? lifecycleState, string self, DateTimeOffset createdOn, DateTimeOffset updatedOn, OracleDatabaseResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + internal OracleDnsPrivateViewProperties(ResourceIdentifier ocid, string displayName, bool isProtected, DnsPrivateViewsLifecycleState lifecycleState, string self, DateTimeOffset createdOn, DateTimeOffset updatedOn, OracleDatabaseResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) { Ocid = ocid; DisplayName = displayName; @@ -90,19 +99,19 @@ internal OracleDnsPrivateViewProperties() } /// The OCID of the view. - public ResourceIdentifier Ocid { get; } + public ResourceIdentifier Ocid { get; set; } /// The display name of the view resource. - public string DisplayName { get; } + public string DisplayName { get; set; } /// A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. - public bool IsProtected { get; } + public bool IsProtected { get; set; } /// Views lifecycleState. - public DnsPrivateViewsLifecycleState? LifecycleState { get; } + public DnsPrivateViewsLifecycleState LifecycleState { get; set; } /// The canonical absolute URL of the resource. - public string Self { get; } + public string Self { get; set; } /// views timeCreated. - public DateTimeOffset CreatedOn { get; } + public DateTimeOffset CreatedOn { get; set; } /// views timeCreated. - public DateTimeOffset UpdatedOn { get; } + public DateTimeOffset UpdatedOn { get; set; } /// Azure resource provisioning state. public OracleDatabaseResourceProvisioningState? ProvisioningState { get; } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateZoneProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateZoneProperties.Serialization.cs index f6a7238773ab..1b9e2a2d38e2 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateZoneProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateZoneProperties.Serialization.cs @@ -34,51 +34,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(OracleDnsPrivateZoneProperties)} does not support writing '{format}' format."); } - if (options.Format != "W") - { - writer.WritePropertyName("ocid"u8); - writer.WriteStringValue(Ocid); - } - if (options.Format != "W") - { - writer.WritePropertyName("isProtected"u8); - writer.WriteBooleanValue(IsProtected); - } - if (options.Format != "W" && Optional.IsDefined(LifecycleState)) - { - writer.WritePropertyName("lifecycleState"u8); - writer.WriteStringValue(LifecycleState.Value.ToString()); - } - if (options.Format != "W") - { - writer.WritePropertyName("self"u8); - writer.WriteStringValue(Self); - } - if (options.Format != "W") - { - writer.WritePropertyName("serial"u8); - writer.WriteNumberValue(Serial); - } - if (options.Format != "W") - { - writer.WritePropertyName("version"u8); - writer.WriteStringValue(Version); - } - if (options.Format != "W" && Optional.IsDefined(ViewId)) + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + writer.WritePropertyName("isProtected"u8); + writer.WriteBooleanValue(IsProtected); + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.ToString()); + writer.WritePropertyName("self"u8); + writer.WriteStringValue(Self); + writer.WritePropertyName("serial"u8); + writer.WriteNumberValue(Serial); + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + if (Optional.IsDefined(ViewId)) { writer.WritePropertyName("viewId"u8); writer.WriteStringValue(ViewId); } - if (options.Format != "W") - { - writer.WritePropertyName("zoneType"u8); - writer.WriteStringValue(ZoneType.ToString()); - } - if (options.Format != "W") - { - writer.WritePropertyName("timeCreated"u8); - writer.WriteStringValue(CreatedOn, "O"); - } + writer.WritePropertyName("zoneType"u8); + writer.WriteStringValue(ZoneType.ToString()); + writer.WritePropertyName("timeCreated"u8); + writer.WriteStringValue(CreatedOn, "O"); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -123,7 +99,7 @@ internal static OracleDnsPrivateZoneProperties DeserializeOracleDnsPrivateZonePr } ResourceIdentifier ocid = default; bool isProtected = default; - DnsPrivateZonesLifecycleState? lifecycleState = default; + DnsPrivateZonesLifecycleState lifecycleState = default; string self = default; int serial = default; string version = default; @@ -147,10 +123,6 @@ internal static OracleDnsPrivateZoneProperties DeserializeOracleDnsPrivateZonePr } if (property.NameEquals("lifecycleState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } lifecycleState = new DnsPrivateZonesLifecycleState(property.Value.GetString()); continue; } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateZoneProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateZoneProperties.cs index 767e429526c0..bb80c4e598d9 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateZoneProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleDnsPrivateZoneProperties.cs @@ -49,15 +49,22 @@ public partial class OracleDnsPrivateZoneProperties /// Initializes a new instance of . /// The OCID of the Zone. /// A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. + /// Zones lifecycleState. /// The canonical absolute URL of the resource. /// The current serial of the zone. As seen in the zone's SOA record. /// Version is the never-repeating, totally-orderable, version of the zone, from which the serial field of the zone's SOA record is derived. /// The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only supported for GLOBAL zones. /// Zones timeCreated. - public OracleDnsPrivateZoneProperties(ResourceIdentifier ocid, bool isProtected, string self, int serial, string version, OracleDnsPrivateZoneType zoneType, DateTimeOffset createdOn) + /// , or is null. + public OracleDnsPrivateZoneProperties(ResourceIdentifier ocid, bool isProtected, DnsPrivateZonesLifecycleState lifecycleState, string self, int serial, string version, OracleDnsPrivateZoneType zoneType, DateTimeOffset createdOn) { + Argument.AssertNotNull(ocid, nameof(ocid)); + Argument.AssertNotNull(self, nameof(self)); + Argument.AssertNotNull(version, nameof(version)); + Ocid = ocid; IsProtected = isProtected; + LifecycleState = lifecycleState; Self = self; Serial = serial; Version = version; @@ -77,7 +84,7 @@ public OracleDnsPrivateZoneProperties(ResourceIdentifier ocid, bool isProtected, /// Zones timeCreated. /// Azure resource provisioning state. /// Keeps track of any properties unknown to the library. - internal OracleDnsPrivateZoneProperties(ResourceIdentifier ocid, bool isProtected, DnsPrivateZonesLifecycleState? lifecycleState, string self, int serial, string version, ResourceIdentifier viewId, OracleDnsPrivateZoneType zoneType, DateTimeOffset createdOn, OracleDatabaseResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + internal OracleDnsPrivateZoneProperties(ResourceIdentifier ocid, bool isProtected, DnsPrivateZonesLifecycleState lifecycleState, string self, int serial, string version, ResourceIdentifier viewId, OracleDnsPrivateZoneType zoneType, DateTimeOffset createdOn, OracleDatabaseResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) { Ocid = ocid; IsProtected = isProtected; @@ -98,23 +105,23 @@ internal OracleDnsPrivateZoneProperties() } /// The OCID of the Zone. - public ResourceIdentifier Ocid { get; } + public ResourceIdentifier Ocid { get; set; } /// A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. - public bool IsProtected { get; } + public bool IsProtected { get; set; } /// Zones lifecycleState. - public DnsPrivateZonesLifecycleState? LifecycleState { get; } + public DnsPrivateZonesLifecycleState LifecycleState { get; set; } /// The canonical absolute URL of the resource. - public string Self { get; } + public string Self { get; set; } /// The current serial of the zone. As seen in the zone's SOA record. - public int Serial { get; } + public int Serial { get; set; } /// Version is the never-repeating, totally-orderable, version of the zone, from which the serial field of the zone's SOA record is derived. - public string Version { get; } + public string Version { get; set; } /// The OCID of the private view containing the zone. This value will be null for zones in the global DNS, which are publicly resolvable and not part of a private view. - public ResourceIdentifier ViewId { get; } + public ResourceIdentifier ViewId { get; set; } /// The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only supported for GLOBAL zones. - public OracleDnsPrivateZoneType ZoneType { get; } + public OracleDnsPrivateZoneType ZoneType { get; set; } /// Zones timeCreated. - public DateTimeOffset CreatedOn { get; } + public DateTimeOffset CreatedOn { get; set; } /// Azure resource provisioning state. public OracleDatabaseResourceProvisioningState? ProvisioningState { get; } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleGIVersionProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleGIVersionProperties.Serialization.cs index 2c8a10aef8cc..3f0b2127c66e 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleGIVersionProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleGIVersionProperties.Serialization.cs @@ -34,11 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(OracleGIVersionProperties)} does not support writing '{format}' format."); } - if (options.Format != "W") - { - writer.WritePropertyName("version"u8); - writer.WriteStringValue(Version); - } + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleGIVersionProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleGIVersionProperties.cs index 1fb55ebcb869..8d5d7252ae85 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleGIVersionProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleGIVersionProperties.cs @@ -47,8 +47,11 @@ internal partial class OracleGIVersionProperties /// Initializes a new instance of . /// A valid Oracle Grid Infrastructure (GI) software version. + /// is null. public OracleGIVersionProperties(string version) { + Argument.AssertNotNull(version, nameof(version)); + Version = version; } @@ -67,6 +70,6 @@ internal OracleGIVersionProperties() } /// A valid Oracle Grid Infrastructure (GI) software version. - public string Version { get; } + public string Version { get; set; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionPatch.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionPatch.cs index 86d3ac06d0a0..0c3c8e379f39 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionPatch.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionPatch.cs @@ -53,7 +53,7 @@ public OracleSubscriptionPatch() /// Initializes a new instance of . /// Details of the resource plan. - /// The updatable properties of the OracleSubscription. + /// The resource-specific properties for this resource. /// Keeps track of any properties unknown to the library. internal OracleSubscriptionPatch(ArmPlan plan, OracleSubscriptionUpdateProperties properties, IDictionary serializedAdditionalRawData) { @@ -64,7 +64,7 @@ internal OracleSubscriptionPatch(ArmPlan plan, OracleSubscriptionUpdatePropertie /// Details of the resource plan. public ArmPlan Plan { get; set; } - /// The updatable properties of the OracleSubscription. + /// The resource-specific properties for this resource. public OracleSubscriptionUpdateProperties Properties { get; set; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.Serialization.cs index 6a9146ffb023..2bb6c4ea5bb6 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.Serialization.cs @@ -69,6 +69,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("intent"u8); writer.WriteStringValue(Intent.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(AzureSubscriptionIds)) + { + writer.WritePropertyName("azureSubscriptionIds"u8); + writer.WriteStartArray(); + foreach (var item in AzureSubscriptionIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(AddSubscriptionOperationState)) + { + writer.WritePropertyName("addSubscriptionOperationState"u8); + writer.WriteStringValue(AddSubscriptionOperationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LastOperationStatusDetail)) + { + writer.WritePropertyName("lastOperationStatusDetail"u8); + writer.WriteStringValue(LastOperationStatusDetail); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -113,6 +133,9 @@ internal static OracleSubscriptionProperties DeserializeOracleSubscriptionProper string termUnit = default; string productCode = default; OracleSubscriptionUpdateIntent? intent = default; + IReadOnlyList azureSubscriptionIds = default; + AddSubscriptionOperationState? addSubscriptionOperationState = default; + string lastOperationStatusDetail = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -168,6 +191,34 @@ internal static OracleSubscriptionProperties DeserializeOracleSubscriptionProper intent = new OracleSubscriptionUpdateIntent(property.Value.GetString()); continue; } + if (property.NameEquals("azureSubscriptionIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + azureSubscriptionIds = array; + continue; + } + if (property.NameEquals("addSubscriptionOperationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + addSubscriptionOperationState = new AddSubscriptionOperationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lastOperationStatusDetail"u8)) + { + lastOperationStatusDetail = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -182,6 +233,9 @@ internal static OracleSubscriptionProperties DeserializeOracleSubscriptionProper termUnit, productCode, intent, + azureSubscriptionIds ?? new ChangeTrackingList(), + addSubscriptionOperationState, + lastOperationStatusDetail, serializedAdditionalRawData); } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.cs index 46663dd20aa9..dfc8fdd17f47 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.cs @@ -49,6 +49,7 @@ public partial class OracleSubscriptionProperties /// Initializes a new instance of . public OracleSubscriptionProperties() { + AzureSubscriptionIds = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -59,8 +60,11 @@ public OracleSubscriptionProperties() /// Term Unit. P1Y, P3Y, etc, see Durations https://en.wikipedia.org/wiki/ISO_8601. /// Product code for the term unit. /// Intent for the update operation. + /// Azure subscriptions to be added. + /// State of the add Azure subscription operation on Oracle subscription. + /// Status details of the last operation on Oracle subscription. /// Keeps track of any properties unknown to the library. - internal OracleSubscriptionProperties(OracleSubscriptionProvisioningState? provisioningState, string saasSubscriptionId, ResourceIdentifier cloudAccountId, CloudAccountProvisioningState? cloudAccountState, string termUnit, string productCode, OracleSubscriptionUpdateIntent? intent, IDictionary serializedAdditionalRawData) + internal OracleSubscriptionProperties(OracleSubscriptionProvisioningState? provisioningState, string saasSubscriptionId, ResourceIdentifier cloudAccountId, CloudAccountProvisioningState? cloudAccountState, string termUnit, string productCode, OracleSubscriptionUpdateIntent? intent, IReadOnlyList azureSubscriptionIds, AddSubscriptionOperationState? addSubscriptionOperationState, string lastOperationStatusDetail, IDictionary serializedAdditionalRawData) { ProvisioningState = provisioningState; SaasSubscriptionId = saasSubscriptionId; @@ -69,6 +73,9 @@ internal OracleSubscriptionProperties(OracleSubscriptionProvisioningState? provi TermUnit = termUnit; ProductCode = productCode; Intent = intent; + AzureSubscriptionIds = azureSubscriptionIds; + AddSubscriptionOperationState = addSubscriptionOperationState; + LastOperationStatusDetail = lastOperationStatusDetail; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -86,5 +93,11 @@ internal OracleSubscriptionProperties(OracleSubscriptionProvisioningState? provi public string ProductCode { get; set; } /// Intent for the update operation. public OracleSubscriptionUpdateIntent? Intent { get; set; } + /// Azure subscriptions to be added. + public IReadOnlyList AzureSubscriptionIds { get; } + /// State of the add Azure subscription operation on Oracle subscription. + public AddSubscriptionOperationState? AddSubscriptionOperationState { get; } + /// Status details of the last operation on Oracle subscription. + public string LastOperationStatusDetail { get; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSystemVersionProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSystemVersionProperties.Serialization.cs index 8746135f1768..fb67b0587070 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSystemVersionProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSystemVersionProperties.Serialization.cs @@ -34,11 +34,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(OracleSystemVersionProperties)} does not support writing '{format}' format."); } - if (options.Format != "W") - { - writer.WritePropertyName("systemVersion"u8); - writer.WriteStringValue(SystemVersion); - } + writer.WritePropertyName("systemVersion"u8); + writer.WriteStringValue(SystemVersion); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSystemVersionProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSystemVersionProperties.cs index 51122b328aed..5c7f8c510e28 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSystemVersionProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSystemVersionProperties.cs @@ -47,8 +47,11 @@ internal partial class OracleSystemVersionProperties /// Initializes a new instance of . /// A valid Oracle System Version. + /// is null. public OracleSystemVersionProperties(string systemVersion) { + Argument.AssertNotNull(systemVersion, nameof(systemVersion)); + SystemVersion = systemVersion; } @@ -67,6 +70,6 @@ internal OracleSystemVersionProperties() } /// A valid Oracle System Version. - public string SystemVersion { get; } + public string SystemVersion { get; set; } } } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.Serialization.cs new file mode 100644 index 000000000000..eea5f18be74f --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + public partial class RemoveVirtualMachineFromExadbVmClusterDetails : 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(RemoveVirtualMachineFromExadbVmClusterDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("dbNodes"u8); + writer.WriteStartArray(); + foreach (var item in DBNodes) + { + 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 + } + } + } + + RemoveVirtualMachineFromExadbVmClusterDetails 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(RemoveVirtualMachineFromExadbVmClusterDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRemoveVirtualMachineFromExadbVmClusterDetails(document.RootElement, options); + } + + internal static RemoveVirtualMachineFromExadbVmClusterDetails DeserializeRemoveVirtualMachineFromExadbVmClusterDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList dbNodes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dbNodes"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DBNodeDetails.DeserializeDBNodeDetails(item, options)); + } + dbNodes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RemoveVirtualMachineFromExadbVmClusterDetails(dbNodes, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RemoveVirtualMachineFromExadbVmClusterDetails)} does not support writing '{options.Format}' format."); + } + } + + RemoveVirtualMachineFromExadbVmClusterDetails 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 DeserializeRemoveVirtualMachineFromExadbVmClusterDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RemoveVirtualMachineFromExadbVmClusterDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.cs new file mode 100644 index 000000000000..281e9caa050c --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.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 System.Linq; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Details of removing Virtual Machines from the Exadata VM cluster on Exascale Infrastructure. Applies to Exadata Database Service on Exascale Infrastructure only. + public partial class RemoveVirtualMachineFromExadbVmClusterDetails + { + /// + /// 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 list of ExaCS DB nodes for the Exadata VM cluster on Exascale Infrastructure to be removed. + /// is null. + public RemoveVirtualMachineFromExadbVmClusterDetails(IEnumerable dbNodes) + { + Argument.AssertNotNull(dbNodes, nameof(dbNodes)); + + DBNodes = dbNodes.ToList(); + } + + /// Initializes a new instance of . + /// The list of ExaCS DB nodes for the Exadata VM cluster on Exascale Infrastructure to be removed. + /// Keeps track of any properties unknown to the library. + internal RemoveVirtualMachineFromExadbVmClusterDetails(IList dbNodes, IDictionary serializedAdditionalRawData) + { + DBNodes = dbNodes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RemoveVirtualMachineFromExadbVmClusterDetails() + { + } + + /// The list of ExaCS DB nodes for the Exadata VM cluster on Exascale Infrastructure to be removed. + public IList DBNodes { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ShapeFamily.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ShapeFamily.cs new file mode 100644 index 000000000000..5eefe1bf5e62 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ShapeFamily.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.OracleDatabase.Models +{ + /// Allowed values for GI Minor Versions shapeFamily filter. + public readonly partial struct ShapeFamily : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ShapeFamily(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ExadataValue = "EXADATA"; + private const string ExadbXsValue = "EXADB_XS"; + + /// Family value for Exadata Shape. + public static ShapeFamily Exadata { get; } = new ShapeFamily(ExadataValue); + /// Family value for Exadb XS Shape. + public static ShapeFamily ExadbXs { get; } = new ShapeFamily(ExadbXsValue); + /// Determines if two values are the same. + public static bool operator ==(ShapeFamily left, ShapeFamily right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ShapeFamily left, ShapeFamily right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ShapeFamily(string value) => new ShapeFamily(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ShapeFamily other && Equals(other); + /// + public bool Equals(ShapeFamily 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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemShape.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemShape.cs new file mode 100644 index 000000000000..a689ea07dd19 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemShape.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.OracleDatabase.Models +{ + /// Allowed values for System Shapes. + public readonly partial struct SystemShape : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SystemShape(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ExadataX9MValue = "Exadata.X9M"; + private const string ExadataX11MValue = "Exadata.X11M"; + private const string ExaDBXsValue = "ExaDbXS"; + + /// Exadata X9M shape. + public static SystemShape ExadataX9M { get; } = new SystemShape(ExadataX9MValue); + /// Exadata X11M shape. + public static SystemShape ExadataX11M { get; } = new SystemShape(ExadataX11MValue); + /// Exadata DB on Exascale Infrastructure shape. + public static SystemShape ExaDBXs { get; } = new SystemShape(ExaDBXsValue); + /// Determines if two values are the same. + public static bool operator ==(SystemShape left, SystemShape right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SystemShape left, SystemShape right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SystemShape(string value) => new SystemShape(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SystemShape other && Equals(other); + /// + public bool Equals(SystemShape 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/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.Serialization.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.Serialization.cs index f458b24c4124..97d9347d2915 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.Serialization.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.Serialization.cs @@ -77,6 +77,8 @@ internal static UnknownAutonomousDatabaseBaseProperties DeserializeUnknownAutono bool? isLocalDataGuardEnabled = default; bool? isRemoteDataGuardEnabled = default; DisasterRecoveryType? localDisasterRecoveryType = default; + DateTimeOffset? timeDisasterRecoveryRoleChanged = default; + DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = default; AutonomousDatabaseStandbySummary localStandbyDB = default; int? failedDataRecoveryInSeconds = default; bool? isMtlsConnectionRequired = default; @@ -302,6 +304,24 @@ internal static UnknownAutonomousDatabaseBaseProperties DeserializeUnknownAutono localDisasterRecoveryType = new DisasterRecoveryType(property.Value.GetString()); continue; } + if (property.NameEquals("timeDisasterRecoveryRoleChanged"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeDisasterRecoveryRoleChanged = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("remoteDisasterRecoveryConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remoteDisasterRecoveryConfiguration = DisasterRecoveryConfigurationDetails.DeserializeDisasterRecoveryConfigurationDetails(property.Value, options); + continue; + } if (property.NameEquals("localStandbyDb"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -820,6 +840,8 @@ internal static UnknownAutonomousDatabaseBaseProperties DeserializeUnknownAutono isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, localStandbyDB, failedDataRecoveryInSeconds, isMtlsConnectionRequired, diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.cs index 41ab62d1d86b..928578fea901 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.cs @@ -30,11 +30,13 @@ internal partial class UnknownAutonomousDatabaseBaseProperties : AutonomousDatab /// The user-friendly name for the Autonomous Database. /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. /// Indicates if auto scaling is enabled for the Autonomous Database storage. - /// The list of [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs. - /// The database OCID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. /// Local Autonomous Disaster Recovery standby database details. /// Indicates the number of seconds of data loss for a Data Guard failover. /// Specifies if the Autonomous Database requires mTLS connections. @@ -91,7 +93,7 @@ internal partial class UnknownAutonomousDatabaseBaseProperties : AutonomousDatab /// Retention period, in days, for long-term backups. /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. /// Keeps track of any properties unknown to the library. - internal UnknownAutonomousDatabaseBaseProperties(string adminPassword, OracleDataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, AutonomousDatabaseComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, AutonomousDatabaseWorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDBIds, string peerDBId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, AutonomousDatabaseStandbySummary localStandbyDB, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, OracleLicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, OracleDatabaseProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, Uri ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? createdOn, DateTimeOffset? maintenanceBeginOn, DateTimeOffset? maintenanceEndOn, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, OracleApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, AutonomousDatabaseConnectionStrings connectionStrings, AutonomousDatabaseConnectionUrls connectionUrls, DataSafeStatusType? dataSafeStatus, OracleDatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupCreatedOn, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, AutonomousDatabaseModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, AutonomousDatabasePermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, DataGuardRoleType? role, Uri serviceConsoleUri, Uri sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, DateTimeOffset? dataGuardRoleChangedOn, DateTimeOffset? freeAutonomousDatabaseDeletedOn, string timeLocalDataGuardEnabled, DateTimeOffset? lastFailoverHappenedOn, DateTimeOffset? lastRefreshHappenedOn, DateTimeOffset? lastRefreshPointTimestamp, DateTimeOffset? lastSwitchoverHappenedOn, DateTimeOffset? freeAutonomousDatabaseStoppedOn, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, ResourceIdentifier ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData) : base(adminPassword, dataBaseType, autonomousMaintenanceScheduleType, characterSet, computeCount, computeModel, cpuCoreCount, customerContacts, dataStorageSizeInTbs, dataStorageSizeInGbs, dbVersion, dbWorkload, displayName, isAutoScalingEnabled, isAutoScalingForStorageEnabled, peerDBIds, peerDBId, isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, localStandbyDB, failedDataRecoveryInSeconds, isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted, licenseModel, ncharacterSet, lifecycleDetails, provisioningState, lifecycleState, scheduledOperations, privateEndpointIP, privateEndpointLabel, ociUri, subnetId, vnetId, createdOn, maintenanceBeginOn, maintenanceEndOn, actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs, apexDetails, availableUpgradeVersions, connectionStrings, connectionUrls, dataSafeStatus, databaseEdition, autonomousDatabaseId, inMemoryAreaInGbs, nextLongTermBackupCreatedOn, longTermBackupSchedule, isPreview, localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs, openMode, operationsInsightsStatus, permissionLevel, privateEndpoint, provisionableCpus, role, serviceConsoleUri, sqlWebDeveloperUri, supportedRegionsToCloneTo, dataGuardRoleChangedOn, freeAutonomousDatabaseDeletedOn, timeLocalDataGuardEnabled, lastFailoverHappenedOn, lastRefreshHappenedOn, lastRefreshPointTimestamp, lastSwitchoverHappenedOn, freeAutonomousDatabaseStoppedOn, usedDataStorageSizeInGbs, usedDataStorageSizeInTbs, ocid, backupRetentionPeriodInDays, whitelistedIPs, serializedAdditionalRawData) + internal UnknownAutonomousDatabaseBaseProperties(string adminPassword, OracleDataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, AutonomousDatabaseComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, AutonomousDatabaseWorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDBIds, string peerDBId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, DateTimeOffset? timeDisasterRecoveryRoleChanged, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration, AutonomousDatabaseStandbySummary localStandbyDB, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, OracleLicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, OracleDatabaseProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, Uri ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? createdOn, DateTimeOffset? maintenanceBeginOn, DateTimeOffset? maintenanceEndOn, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, OracleApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, AutonomousDatabaseConnectionStrings connectionStrings, AutonomousDatabaseConnectionUrls connectionUrls, DataSafeStatusType? dataSafeStatus, OracleDatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupCreatedOn, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, AutonomousDatabaseModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, AutonomousDatabasePermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, DataGuardRoleType? role, Uri serviceConsoleUri, Uri sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, DateTimeOffset? dataGuardRoleChangedOn, DateTimeOffset? freeAutonomousDatabaseDeletedOn, string timeLocalDataGuardEnabled, DateTimeOffset? lastFailoverHappenedOn, DateTimeOffset? lastRefreshHappenedOn, DateTimeOffset? lastRefreshPointTimestamp, DateTimeOffset? lastSwitchoverHappenedOn, DateTimeOffset? freeAutonomousDatabaseStoppedOn, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, ResourceIdentifier ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData) : base(adminPassword, dataBaseType, autonomousMaintenanceScheduleType, characterSet, computeCount, computeModel, cpuCoreCount, customerContacts, dataStorageSizeInTbs, dataStorageSizeInGbs, dbVersion, dbWorkload, displayName, isAutoScalingEnabled, isAutoScalingForStorageEnabled, peerDBIds, peerDBId, isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, timeDisasterRecoveryRoleChanged, remoteDisasterRecoveryConfiguration, localStandbyDB, failedDataRecoveryInSeconds, isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted, licenseModel, ncharacterSet, lifecycleDetails, provisioningState, lifecycleState, scheduledOperations, privateEndpointIP, privateEndpointLabel, ociUri, subnetId, vnetId, createdOn, maintenanceBeginOn, maintenanceEndOn, actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs, apexDetails, availableUpgradeVersions, connectionStrings, connectionUrls, dataSafeStatus, databaseEdition, autonomousDatabaseId, inMemoryAreaInGbs, nextLongTermBackupCreatedOn, longTermBackupSchedule, isPreview, localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs, openMode, operationsInsightsStatus, permissionLevel, privateEndpoint, provisionableCpus, role, serviceConsoleUri, sqlWebDeveloperUri, supportedRegionsToCloneTo, dataGuardRoleChangedOn, freeAutonomousDatabaseDeletedOn, timeLocalDataGuardEnabled, lastFailoverHappenedOn, lastRefreshHappenedOn, lastRefreshPointTimestamp, lastSwitchoverHappenedOn, freeAutonomousDatabaseStoppedOn, usedDataStorageSizeInGbs, usedDataStorageSizeInTbs, ocid, backupRetentionPeriodInDays, whitelistedIPs, serializedAdditionalRawData) { DataBaseType = dataBaseType; } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBServerCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBServerCollection.cs index 1974818dcd46..495042eb8e7b 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBServerCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBServerCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string dbse /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -150,11 +150,11 @@ public virtual Response Get(string dbserverocid, Cancell /// /// /// Operation Id - /// DbServers_ListByCloudExadataInfrastructure + /// DbServers_ListByParent /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -166,8 +166,8 @@ public virtual Response Get(string dbserverocid, Cancell /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _oracleDBServerDBServersRestClient.CreateListByCloudExadataInfrastructureRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _oracleDBServerDBServersRestClient.CreateListByCloudExadataInfrastructureNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _oracleDBServerDBServersRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _oracleDBServerDBServersRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OracleDBServerResource(Client, OracleDBServerData.DeserializeOracleDBServerData(e)), _oracleDBServerDBServersClientDiagnostics, Pipeline, "OracleDBServerCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -180,11 +180,11 @@ public virtual AsyncPageable GetAllAsync(CancellationTok /// /// /// Operation Id - /// DbServers_ListByCloudExadataInfrastructure + /// DbServers_ListByParent /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -196,8 +196,8 @@ public virtual AsyncPageable GetAllAsync(CancellationTok /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _oracleDBServerDBServersRestClient.CreateListByCloudExadataInfrastructureRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _oracleDBServerDBServersRestClient.CreateListByCloudExadataInfrastructureNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _oracleDBServerDBServersRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _oracleDBServerDBServersRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OracleDBServerResource(Client, OracleDBServerData.DeserializeOracleDBServerData(e)), _oracleDBServerDBServersClientDiagnostics, Pipeline, "OracleDBServerCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationToken cancell /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string dbserverocid, Cance /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string dbserverocid, CancellationToken canc /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> GetIfExistsA /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBServerResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBServerResource.cs index d73223aa38b7..f33c326ec5a4 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBServerResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBServerResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancellatio /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBSystemShapeCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBSystemShapeCollection.cs index cfd4a43143f5..598ee11c72e2 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBSystemShapeCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBSystemShapeCollection.cs @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual Response Get(string dbsystemshapenam } /// - /// List DbSystemShape resources by Location + /// List DbSystemShape resources by SubscriptionLocationResource /// /// /// Request Path @@ -158,7 +158,7 @@ public virtual Response Get(string dbsystemshapenam /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -166,17 +166,18 @@ public virtual Response Get(string dbsystemshapenam /// /// /// + /// Filters the result for the given Azure Availability Zone. /// 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) + public virtual AsyncPageable GetAllAsync(string zone = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _oracleDBSystemShapeDBSystemShapesRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _oracleDBSystemShapeDBSystemShapesRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage FirstPageRequest(int? pageSizeHint) => _oracleDBSystemShapeDBSystemShapesRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location), zone); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _oracleDBSystemShapeDBSystemShapesRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location), zone); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OracleDBSystemShapeResource(Client, OracleDBSystemShapeData.DeserializeOracleDBSystemShapeData(e)), _oracleDBSystemShapeDBSystemShapesClientDiagnostics, Pipeline, "OracleDBSystemShapeCollection.GetAll", "value", "nextLink", cancellationToken); } /// - /// List DbSystemShape resources by Location + /// List DbSystemShape resources by SubscriptionLocationResource /// /// /// Request Path @@ -188,7 +189,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -196,12 +197,13 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// + /// Filters the result for the given Azure Availability Zone. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string zone = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _oracleDBSystemShapeDBSystemShapesRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _oracleDBSystemShapeDBSystemShapesRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage FirstPageRequest(int? pageSizeHint) => _oracleDBSystemShapeDBSystemShapesRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location), zone); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _oracleDBSystemShapeDBSystemShapesRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location), zone); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OracleDBSystemShapeResource(Client, OracleDBSystemShapeData.DeserializeOracleDBSystemShapeData(e)), _oracleDBSystemShapeDBSystemShapesClientDiagnostics, Pipeline, "OracleDBSystemShapeCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -218,7 +220,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -261,7 +263,7 @@ public virtual async Task> ExistsAsync(string dbsystemshapename, /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -304,7 +306,7 @@ public virtual Response Exists(string dbsystemshapename, CancellationToken /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -349,7 +351,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBSystemShapeResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBSystemShapeResource.cs index 5ad08f145310..00fea7470a2e 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBSystemShapeResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDBSystemShapeResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateViewCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateViewCollection.cs index bf4e4e1f9634..e6549140d47d 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateViewCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateViewCollection.cs @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual Response Get(string dnsprivateviewo } /// - /// List DnsPrivateView resources by Location + /// List DnsPrivateView resources by SubscriptionLocationResource /// /// /// Request Path @@ -158,7 +158,7 @@ public virtual Response Get(string dnsprivateviewo /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -176,7 +176,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat } /// - /// List DnsPrivateView resources by Location + /// List DnsPrivateView resources by SubscriptionLocationResource /// /// /// Request Path @@ -188,7 +188,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -261,7 +261,7 @@ public virtual async Task> ExistsAsync(string dnsprivateviewocid, /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -304,7 +304,7 @@ public virtual Response Exists(string dnsprivateviewocid, CancellationToke /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -349,7 +349,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateViewResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateViewResource.cs index 06d1a5566821..0e1b1de343d9 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateViewResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateViewResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateZoneCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateZoneCollection.cs index 640c59409848..f150f42a8b10 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateZoneCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateZoneCollection.cs @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual Response Get(string dnsprivatezonen } /// - /// List DnsPrivateZone resources by Location + /// List DnsPrivateZone resources by SubscriptionLocationResource /// /// /// Request Path @@ -158,7 +158,7 @@ public virtual Response Get(string dnsprivatezonen /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -176,7 +176,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat } /// - /// List DnsPrivateZone resources by Location + /// List DnsPrivateZone resources by SubscriptionLocationResource /// /// /// Request Path @@ -188,7 +188,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -261,7 +261,7 @@ public virtual async Task> ExistsAsync(string dnsprivatezonename, /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -304,7 +304,7 @@ public virtual Response Exists(string dnsprivatezonename, CancellationToke /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -349,7 +349,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateZoneResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateZoneResource.cs index 2d439010f542..8f5ac1d711b7 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateZoneResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleDnsPrivateZoneResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleGIVersionCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleGIVersionCollection.cs index fa4d6ea40d66..90cc62bb1ff1 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleGIVersionCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleGIVersionCollection.cs @@ -14,6 +14,7 @@ using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.OracleDatabase.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.OracleDatabase @@ -68,7 +69,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -113,7 +114,7 @@ public virtual async Task> GetAsync(string giv /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -146,7 +147,7 @@ public virtual Response Get(string giversionname, Cance } /// - /// List GiVersion resources by Location + /// List GiVersion resources by SubscriptionLocationResource /// /// /// Request Path @@ -158,7 +159,7 @@ public virtual Response Get(string giversionname, Cance /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -166,17 +167,19 @@ public virtual Response Get(string giversionname, Cance /// /// /// + /// If provided, filters the results for the given shape. + /// Filters the result for the given Azure Availability Zone. /// 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) + public virtual AsyncPageable GetAllAsync(SystemShape? shape = null, string zone = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _oracleGIVersionGiVersionsRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _oracleGIVersionGiVersionsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage FirstPageRequest(int? pageSizeHint) => _oracleGIVersionGiVersionsRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location), shape, zone); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _oracleGIVersionGiVersionsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location), shape, zone); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new OracleGIVersionResource(Client, OracleGIVersionData.DeserializeOracleGIVersionData(e)), _oracleGIVersionGiVersionsClientDiagnostics, Pipeline, "OracleGIVersionCollection.GetAll", "value", "nextLink", cancellationToken); } /// - /// List GiVersion resources by Location + /// List GiVersion resources by SubscriptionLocationResource /// /// /// Request Path @@ -188,7 +191,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -196,12 +199,14 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// + /// If provided, filters the results for the given shape. + /// Filters the result for the given Azure Availability Zone. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + public virtual Pageable GetAll(SystemShape? shape = null, string zone = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _oracleGIVersionGiVersionsRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _oracleGIVersionGiVersionsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage FirstPageRequest(int? pageSizeHint) => _oracleGIVersionGiVersionsRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location), shape, zone); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _oracleGIVersionGiVersionsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location), shape, zone); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new OracleGIVersionResource(Client, OracleGIVersionData.DeserializeOracleGIVersionData(e)), _oracleGIVersionGiVersionsClientDiagnostics, Pipeline, "OracleGIVersionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -218,7 +223,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -261,7 +266,7 @@ public virtual async Task> ExistsAsync(string giversionname, Canc /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -304,7 +309,7 @@ public virtual Response Exists(string giversionname, CancellationToken can /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -349,7 +354,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleGIVersionResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleGIVersionResource.cs index 9e98955a7b92..a3578ef2b460 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleGIVersionResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleGIVersionResource.cs @@ -88,6 +88,75 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of GiMinorVersionResources in the OracleGIVersion. + /// An object representing collection of GiMinorVersionResources and their operations over a GiMinorVersionResource. + public virtual GiMinorVersionCollection GetGiMinorVersions() + { + return GetCachedClient(client => new GiMinorVersionCollection(client, Id)); + } + + /// + /// Get a GiMinorVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersions_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGiMinorVersionAsync(string giMinorVersionName, CancellationToken cancellationToken = default) + { + return await GetGiMinorVersions().GetAsync(giMinorVersionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a GiMinorVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersions_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGiMinorVersion(string giMinorVersionName, CancellationToken cancellationToken = default) + { + return GetGiMinorVersions().Get(giMinorVersionName, cancellationToken); + } + /// /// Get a GiVersion /// @@ -101,7 +170,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +210,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionResource.cs index e54faa78b31c..6b91c6a53671 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionResource.cs @@ -100,7 +100,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -180,7 +180,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -222,7 +222,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -264,7 +264,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -310,7 +310,7 @@ public virtual async Task> UpdateAsync( /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -435,6 +435,98 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil } } + /// + /// Add Azure Subscriptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/addAzureSubscriptions + /// + /// + /// Operation Id + /// OracleSubscriptions_AddAzureSubscriptions + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task AddAzureSubscriptionsAsync(WaitUntil waitUntil, AzureSubscriptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.AddAzureSubscriptions"); + scope.Start(); + try + { + var response = await _oracleSubscriptionRestClient.AddAzureSubscriptionsAsync(Id.SubscriptionId, body, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateAddAzureSubscriptionsRequest(Id.SubscriptionId, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add Azure Subscriptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/addAzureSubscriptions + /// + /// + /// Operation Id + /// OracleSubscriptions_AddAzureSubscriptions + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation AddAzureSubscriptions(WaitUntil waitUntil, AzureSubscriptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.AddAzureSubscriptions"); + scope.Start(); + try + { + var response = _oracleSubscriptionRestClient.AddAzureSubscriptions(Id.SubscriptionId, body, cancellationToken); + var operation = new OracleDatabaseArmOperation(_oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateAddAzureSubscriptionsRequest(Id.SubscriptionId, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// List Activation Links /// @@ -448,7 +540,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -490,7 +582,7 @@ public virtual async Task> GetActivati /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -532,7 +624,7 @@ public virtual ArmOperation GetActivationLinks(Wait /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -574,7 +666,7 @@ public virtual async Task> GetCloudAccountDeta /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -616,7 +708,7 @@ public virtual ArmOperation GetCloudAccountDetails(WaitUnti /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -658,7 +750,7 @@ public virtual async Task> GetSaasSubscrip /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSystemVersionCollection.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSystemVersionCollection.cs index c9bee9e10153..9aaf69d449ee 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSystemVersionCollection.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSystemVersionCollection.cs @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual Response Get(string systemversionnam } /// - /// List SystemVersion resources by Location + /// List SystemVersion resources by SubscriptionLocationResource /// /// /// Request Path @@ -158,7 +158,7 @@ public virtual Response Get(string systemversionnam /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -176,7 +176,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati } /// - /// List SystemVersion resources by Location + /// List SystemVersion resources by SubscriptionLocationResource /// /// /// Request Path @@ -188,7 +188,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -261,7 +261,7 @@ public virtual async Task> ExistsAsync(string systemversionname, /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -304,7 +304,7 @@ public virtual Response Exists(string systemversionname, CancellationToken /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -349,7 +349,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSystemVersionResource.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSystemVersionResource.cs index 3ccef66e54d9..32ea8eb7c388 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSystemVersionResource.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSystemVersionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2023-09-01 + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseBackupsRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseBackupsRestOperations.cs index d75d85c185e9..31af82096c9b 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseBackupsRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseBackupsRestOperations.cs @@ -32,11 +32,11 @@ public AutonomousDatabaseBackupsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListByAutonomousDatabaseRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename) + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -51,7 +51,7 @@ internal RequestUriBuilder CreateListByAutonomousDatabaseRequestUri(string subsc return uri; } - internal HttpMessage CreateListByAutonomousDatabaseRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename) + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -79,13 +79,13 @@ internal HttpMessage CreateListByAutonomousDatabaseRequest(string subscriptionId /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByAutonomousDatabaseAsync(string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) + public async Task> ListByParentAsync(string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); - using var message = CreateListByAutonomousDatabaseRequest(subscriptionId, resourceGroupName, autonomousdatabasename); + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, autonomousdatabasename); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -108,13 +108,13 @@ public async Task> ListByAutonomous /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListByAutonomousDatabase(string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) + public Response ListByParent(string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); - using var message = CreateListByAutonomousDatabaseRequest(subscriptionId, resourceGroupName, autonomousdatabasename); + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, autonomousdatabasename); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -526,7 +526,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string a } } - internal RequestUriBuilder CreateListByAutonomousDatabaseNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string autonomousdatabasename) + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string autonomousdatabasename) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -534,7 +534,7 @@ internal RequestUriBuilder CreateListByAutonomousDatabaseNextPageRequestUri(stri return uri; } - internal HttpMessage CreateListByAutonomousDatabaseNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string autonomousdatabasename) + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string autonomousdatabasename) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -556,14 +556,14 @@ internal HttpMessage CreateListByAutonomousDatabaseNextPageRequest(string nextLi /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByAutonomousDatabaseNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); - using var message = CreateListByAutonomousDatabaseNextPageRequest(nextLink, subscriptionId, resourceGroupName, autonomousdatabasename); + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, autonomousdatabasename); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -587,14 +587,14 @@ public async Task> ListByAutonomous /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListByAutonomousDatabaseNextPage(string nextLink, string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) + public Response ListByParentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); - using var message = CreateListByAutonomousDatabaseNextPageRequest(nextLink, subscriptionId, resourceGroupName, autonomousdatabasename); + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, autonomousdatabasename); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseCharacterSetsRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseCharacterSetsRestOperations.cs index fcc44ef037a1..608f183896d1 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseCharacterSetsRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseCharacterSetsRestOperations.cs @@ -32,7 +32,7 @@ public AutonomousDatabaseCharacterSetsRestOperations(HttpPipeline pipeline, stri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -68,7 +68,7 @@ internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLoc return message; } - /// List AutonomousDatabaseCharacterSet resources by Location. + /// List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. /// The cancellation token to use. @@ -94,7 +94,7 @@ public async Task> ListByLoca } } - /// List AutonomousDatabaseCharacterSet resources by Location. + /// List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. /// The cancellation token to use. @@ -236,7 +236,7 @@ internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string return message; } - /// List AutonomousDatabaseCharacterSet resources by Location. + /// List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. @@ -264,7 +264,7 @@ public async Task> ListByLoca } } - /// List AutonomousDatabaseCharacterSet resources by Location. + /// List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseNationalCharacterSetsRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseNationalCharacterSetsRestOperations.cs index 2467abf19e58..ae427015573b 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseNationalCharacterSetsRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseNationalCharacterSetsRestOperations.cs @@ -32,7 +32,7 @@ public AutonomousDatabaseNationalCharacterSetsRestOperations(HttpPipeline pipeli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -68,7 +68,7 @@ internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLoc return message; } - /// List AutonomousDatabaseNationalCharacterSet resources by Location. + /// List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. /// The cancellation token to use. @@ -94,7 +94,7 @@ public async Task> Li } } - /// List AutonomousDatabaseNationalCharacterSet resources by Location. + /// List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. /// The cancellation token to use. @@ -236,7 +236,7 @@ internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string return message; } - /// List AutonomousDatabaseNationalCharacterSet resources by Location. + /// List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. @@ -264,7 +264,7 @@ public async Task> Li } } - /// List AutonomousDatabaseNationalCharacterSet resources by Location. + /// List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseVersionsRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseVersionsRestOperations.cs index 1ea61565ef78..6ac2b4304c8c 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseVersionsRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseVersionsRestOperations.cs @@ -32,7 +32,7 @@ public AutonomousDatabaseVersionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -68,7 +68,7 @@ internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLoc return message; } - /// List AutonomousDbVersion resources by Location. + /// List AutonomousDbVersion resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. /// The cancellation token to use. @@ -94,7 +94,7 @@ public async Task> ListByLocationAsync(s } } - /// List AutonomousDbVersion resources by Location. + /// List AutonomousDbVersion resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. /// The cancellation token to use. @@ -236,7 +236,7 @@ internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string return message; } - /// List AutonomousDbVersion resources by Location. + /// List AutonomousDbVersion resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. @@ -264,7 +264,7 @@ public async Task> ListByLocationNextPag } } - /// List AutonomousDbVersion resources by Location. + /// List AutonomousDbVersion resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabasesRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabasesRestOperations.cs index 02e1244e50ff..84018fce444a 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabasesRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabasesRestOperations.cs @@ -32,7 +32,7 @@ public AutonomousDatabasesRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -564,6 +564,100 @@ public Response Delete(string subscriptionId, string resourceGroupName, string a } } + internal RequestUriBuilder CreateChangeDisasterRecoveryConfigurationRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename, DisasterRecoveryConfigurationDetails details) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/changeDisasterRecoveryConfiguration", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateChangeDisasterRecoveryConfigurationRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename, DisasterRecoveryConfigurationDetails details) + { + 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/changeDisasterRecoveryConfiguration", 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(details, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task ChangeDisasterRecoveryConfigurationAsync(string subscriptionId, string resourceGroupName, string autonomousdatabasename, DisasterRecoveryConfigurationDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateChangeDisasterRecoveryConfigurationRequest(subscriptionId, resourceGroupName, autonomousdatabasename, details); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ChangeDisasterRecoveryConfiguration(string subscriptionId, string resourceGroupName, string autonomousdatabasename, DisasterRecoveryConfigurationDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateChangeDisasterRecoveryConfigurationRequest(subscriptionId, resourceGroupName, autonomousdatabasename, details); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateFailoverRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename, AutonomousDatabaseActionContent content) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudExadataInfrastructuresRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudExadataInfrastructuresRestOperations.cs index d610bcaacee5..920f7478161b 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudExadataInfrastructuresRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudExadataInfrastructuresRestOperations.cs @@ -32,7 +32,7 @@ public CloudExadataInfrastructuresRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudVmClustersRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudVmClustersRestOperations.cs index 11661c395a2a..b1ac9c5fa054 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudVmClustersRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudVmClustersRestOperations.cs @@ -33,7 +33,7 @@ public CloudVmClustersRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbNodesRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbNodesRestOperations.cs index 80be1139e4ad..1e5ae8cc83d3 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbNodesRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbNodesRestOperations.cs @@ -32,11 +32,11 @@ public DbNodesRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListByCloudVmClusterRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername) + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -51,7 +51,7 @@ internal RequestUriBuilder CreateListByCloudVmClusterRequestUri(string subscript return uri; } - internal HttpMessage CreateListByCloudVmClusterRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername) + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -79,13 +79,13 @@ internal HttpMessage CreateListByCloudVmClusterRequest(string subscriptionId, st /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByCloudVmClusterAsync(string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + public async Task> ListByParentAsync(string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); - using var message = CreateListByCloudVmClusterRequest(subscriptionId, resourceGroupName, cloudvmclustername); + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, cloudvmclustername); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -108,13 +108,13 @@ public async Task> ListByCloudVmClusterAsync(string s /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListByCloudVmCluster(string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + public Response ListByParent(string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); - using var message = CreateListByCloudVmClusterRequest(subscriptionId, resourceGroupName, cloudvmclustername); + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, cloudvmclustername); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -336,7 +336,7 @@ public Response Action(string subscriptionId, string resourceGroupName, string c } } - internal RequestUriBuilder CreateListByCloudVmClusterNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername) + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -344,7 +344,7 @@ internal RequestUriBuilder CreateListByCloudVmClusterNextPageRequestUri(string n return uri; } - internal HttpMessage CreateListByCloudVmClusterNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername) + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -366,14 +366,14 @@ internal HttpMessage CreateListByCloudVmClusterNextPageRequest(string nextLink, /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByCloudVmClusterNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); - using var message = CreateListByCloudVmClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudvmclustername); + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudvmclustername); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -397,14 +397,14 @@ public async Task> ListByCloudVmClusterNextPageAsync( /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListByCloudVmClusterNextPage(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + public Response ListByParentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); - using var message = CreateListByCloudVmClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudvmclustername); + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudvmclustername); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbServersRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbServersRestOperations.cs index f99411674f17..90b3c68885e1 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbServersRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbServersRestOperations.cs @@ -32,11 +32,11 @@ public DbServersRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListByCloudExadataInfrastructureRequestUri(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -51,7 +51,7 @@ internal RequestUriBuilder CreateListByCloudExadataInfrastructureRequestUri(stri return uri; } - internal HttpMessage CreateListByCloudExadataInfrastructureRequest(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -79,13 +79,13 @@ internal HttpMessage CreateListByCloudExadataInfrastructureRequest(string subscr /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByCloudExadataInfrastructureAsync(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + public async Task> ListByParentAsync(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); - using var message = CreateListByCloudExadataInfrastructureRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -108,13 +108,13 @@ public async Task> ListByCloudExadataInfrastructure /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListByCloudExadataInfrastructure(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + public Response ListByParent(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); - using var message = CreateListByCloudExadataInfrastructureRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -234,7 +234,7 @@ public Response Get(string subscriptionId, string resourceGr } } - internal RequestUriBuilder CreateListByCloudExadataInfrastructureNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -242,7 +242,7 @@ internal RequestUriBuilder CreateListByCloudExadataInfrastructureNextPageRequest return uri; } - internal HttpMessage CreateListByCloudExadataInfrastructureNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -264,14 +264,14 @@ internal HttpMessage CreateListByCloudExadataInfrastructureNextPageRequest(strin /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByCloudExadataInfrastructureNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); - using var message = CreateListByCloudExadataInfrastructureNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudexadatainfrastructurename); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -295,14 +295,14 @@ public async Task> ListByCloudExadataInfrastructure /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListByCloudExadataInfrastructureNextPage(string nextLink, string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + public Response ListByParentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); - using var message = CreateListByCloudExadataInfrastructureNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudexadatainfrastructurename); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbSystemShapesRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbSystemShapesRestOperations.cs index bed041b8c7d6..63997a78c710 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbSystemShapesRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbSystemShapesRestOperations.cs @@ -32,11 +32,11 @@ public DbSystemShapesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListByLocationRequestUri(string subscriptionId, AzureLocation location) + internal RequestUriBuilder CreateListByLocationRequestUri(string subscriptionId, AzureLocation location, string zone) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,10 +46,14 @@ internal RequestUriBuilder CreateListByLocationRequestUri(string subscriptionId, uri.AppendPath(location, true); uri.AppendPath("/dbSystemShapes", false); uri.AppendQuery("api-version", _apiVersion, true); + if (zone != null) + { + uri.AppendQuery("zone", zone, true); + } return uri; } - internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLocation location) + internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLocation location, string zone) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -62,23 +66,28 @@ internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLoc uri.AppendPath(location, true); uri.AppendPath("/dbSystemShapes", false); uri.AppendQuery("api-version", _apiVersion, true); + if (zone != null) + { + uri.AppendQuery("zone", zone, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// List DbSystemShape resources by Location. + /// List DbSystemShape resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. + /// Filters the result for the given Azure Availability Zone. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListByLocationAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + public async Task> ListByLocationAsync(string subscriptionId, AzureLocation location, string zone = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListByLocationRequest(subscriptionId, location); + using var message = CreateListByLocationRequest(subscriptionId, location, zone); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -94,17 +103,18 @@ public async Task> ListByLocationAsync(string } } - /// List DbSystemShape resources by Location. + /// List DbSystemShape resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. + /// Filters the result for the given Azure Availability Zone. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public Response ListByLocation(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + public Response ListByLocation(string subscriptionId, AzureLocation location, string zone = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListByLocationRequest(subscriptionId, location); + using var message = CreateListByLocationRequest(subscriptionId, location, zone); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -214,7 +224,7 @@ public Response Get(string subscriptionId, AzureLocatio } } - internal RequestUriBuilder CreateListByLocationNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location) + internal RequestUriBuilder CreateListByLocationNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location, string zone) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -222,7 +232,7 @@ internal RequestUriBuilder CreateListByLocationNextPageRequestUri(string nextLin return uri; } - internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string subscriptionId, AzureLocation location) + internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string subscriptionId, AzureLocation location, string zone) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -236,19 +246,20 @@ internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string return message; } - /// List DbSystemShape resources by Location. + /// List DbSystemShape resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. + /// Filters the result for the given Azure Availability Zone. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListByLocationNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + public async Task> ListByLocationNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, string zone = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location, zone); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -264,19 +275,20 @@ public async Task> ListByLocationNextPageAsync } } - /// List DbSystemShape resources by Location. + /// List DbSystemShape resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. + /// Filters the result for the given Azure Availability Zone. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListByLocationNextPage(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + public Response ListByLocationNextPage(string nextLink, string subscriptionId, AzureLocation location, string zone = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location, zone); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateViewsRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateViewsRestOperations.cs index 3bc53cc29f7d..43fa0bcee50d 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateViewsRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateViewsRestOperations.cs @@ -32,7 +32,7 @@ public DnsPrivateViewsRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -68,7 +68,7 @@ internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLoc return message; } - /// List DnsPrivateView resources by Location. + /// List DnsPrivateView resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. /// The cancellation token to use. @@ -94,7 +94,7 @@ public async Task> ListByLocationAsync(string } } - /// List DnsPrivateView resources by Location. + /// List DnsPrivateView resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. /// The cancellation token to use. @@ -236,7 +236,7 @@ internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string return message; } - /// List DnsPrivateView resources by Location. + /// List DnsPrivateView resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. @@ -264,7 +264,7 @@ public async Task> ListByLocationNextPageAsyn } } - /// List DnsPrivateView resources by Location. + /// List DnsPrivateView resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateZonesRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateZonesRestOperations.cs index c57ffa235af3..e1d46b1ad645 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateZonesRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateZonesRestOperations.cs @@ -32,7 +32,7 @@ public DnsPrivateZonesRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -68,7 +68,7 @@ internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLoc return message; } - /// List DnsPrivateZone resources by Location. + /// List DnsPrivateZone resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. /// The cancellation token to use. @@ -94,7 +94,7 @@ public async Task> ListByLocationAsync(string } } - /// List DnsPrivateZone resources by Location. + /// List DnsPrivateZone resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. /// The cancellation token to use. @@ -236,7 +236,7 @@ internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string return message; } - /// List DnsPrivateZone resources by Location. + /// List DnsPrivateZone resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. @@ -264,7 +264,7 @@ public async Task> ListByLocationNextPageAsyn } } - /// List DnsPrivateZone resources by Location. + /// List DnsPrivateZone resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExadbVmClustersRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExadbVmClustersRestOperations.cs new file mode 100644 index 000000000000..1ea6679d149c --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExadbVmClustersRestOperations.cs @@ -0,0 +1,817 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class ExadbVmClustersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ExadbVmClustersRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ExadbVmClustersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters", 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/Oracle.Database/exadbVmClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExadbVmCluster resources by subscription ID. + /// 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: + { + ExadbVmClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExadbVmCluster resources by subscription ID. + /// 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: + { + ExadbVmClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExadbVmCluster resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExadbVmClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExadbVmCluster resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExadbVmClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// 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 exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, exadbVmClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExadbVmClusterData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExadbVmClusterData.DeserializeExadbVmClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExadbVmClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// 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 exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, exadbVmClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExadbVmClusterData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExadbVmClusterData.DeserializeExadbVmClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExadbVmClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string exadbVmClusterName, ExadbVmClusterData 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName, ExadbVmClusterData 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, 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 ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string exadbVmClusterName, ExadbVmClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, exadbVmClusterName, 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); + } + } + + /// Create a ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string exadbVmClusterName, ExadbVmClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, exadbVmClusterName, 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 exadbVmClusterName, ExadbVmClusterPatch 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName, ExadbVmClusterPatch 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, 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; + } + + /// Update a ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The resource properties to be updated. + /// 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 exadbVmClusterName, ExadbVmClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, exadbVmClusterName, 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); + } + } + + /// Update a ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The resource properties to be updated. + /// 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 exadbVmClusterName, ExadbVmClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, exadbVmClusterName, 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 exadbVmClusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// 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 exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, exadbVmClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// 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 exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, exadbVmClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRemoveVmsRequestUri(string subscriptionId, string resourceGroupName, string exadbVmClusterName, RemoveVirtualMachineFromExadbVmClusterDetails details) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/removeVms", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRemoveVmsRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName, RemoveVirtualMachineFromExadbVmClusterDetails details) + { + 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/removeVms", 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(details, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Remove VMs from the VM Cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task RemoveVmsAsync(string subscriptionId, string resourceGroupName, string exadbVmClusterName, RemoveVirtualMachineFromExadbVmClusterDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateRemoveVmsRequest(subscriptionId, resourceGroupName, exadbVmClusterName, details); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Remove VMs from the VM Cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response RemoveVms(string subscriptionId, string resourceGroupName, string exadbVmClusterName, RemoveVirtualMachineFromExadbVmClusterDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateRemoveVmsRequest(subscriptionId, resourceGroupName, exadbVmClusterName, details); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return 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; + } + + /// List ExadbVmCluster resources by subscription ID. + /// 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: + { + ExadbVmClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExadbVmCluster resources by subscription ID. + /// 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: + { + ExadbVmClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExadbVmCluster resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExadbVmClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExadbVmCluster resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExadbVmClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbNodesRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbNodesRestOperations.cs new file mode 100644 index 000000000000..74f890836799 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbNodesRestOperations.cs @@ -0,0 +1,423 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class ExascaleDbNodesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ExascaleDbNodesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ExascaleDbNodesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/dbNodes", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/dbNodes", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExascaleDbNode resources by ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentAsync(string subscriptionId, string resourceGroupName, string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, exadbVmClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExascaleDBNodeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDBNodeListResult.DeserializeExascaleDBNodeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExascaleDbNode resources by ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParent(string subscriptionId, string resourceGroupName, string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, exadbVmClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExascaleDBNodeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDBNodeListResult.DeserializeExascaleDBNodeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string exadbVmClusterName, string exascaleDBNodeName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/dbNodes/", false); + uri.AppendPath(exascaleDBNodeName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName, string exascaleDBNodeName) + { + 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/dbNodes/", false); + uri.AppendPath(exascaleDBNodeName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a ExascaleDbNode. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The name of the ExascaleDbNode. + /// 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 exadbVmClusterName, string exascaleDBNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNullOrEmpty(exascaleDBNodeName, nameof(exascaleDBNodeName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, exadbVmClusterName, exascaleDBNodeName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExascaleDBNodeData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDBNodeData.DeserializeExascaleDBNodeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExascaleDBNodeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a ExascaleDbNode. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The name of the ExascaleDbNode. + /// 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 exadbVmClusterName, string exascaleDBNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNullOrEmpty(exascaleDBNodeName, nameof(exascaleDBNodeName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, exadbVmClusterName, exascaleDBNodeName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExascaleDBNodeData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDBNodeData.DeserializeExascaleDBNodeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExascaleDBNodeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateActionRequestUri(string subscriptionId, string resourceGroupName, string exadbVmClusterName, string exascaleDBNodeName, DBNodeAction 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/dbNodes/", false); + uri.AppendPath(exascaleDBNodeName, true); + uri.AppendPath("/action", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateActionRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName, string exascaleDBNodeName, DBNodeAction 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/dbNodes/", false); + uri.AppendPath(exascaleDBNodeName, true); + uri.AppendPath("/action", 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; + } + + /// VM actions on DbNode of ExadbVmCluster by the provided filter. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The name of the ExascaleDbNode. + /// The content of the action request. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task ActionAsync(string subscriptionId, string resourceGroupName, string exadbVmClusterName, string exascaleDBNodeName, DBNodeAction body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNullOrEmpty(exascaleDBNodeName, nameof(exascaleDBNodeName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateActionRequest(subscriptionId, resourceGroupName, exadbVmClusterName, exascaleDBNodeName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// VM actions on DbNode of ExadbVmCluster by the provided filter. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The name of the ExascaleDbNode. + /// The content of the action request. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Action(string subscriptionId, string resourceGroupName, string exadbVmClusterName, string exascaleDBNodeName, DBNodeAction body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNullOrEmpty(exascaleDBNodeName, nameof(exascaleDBNodeName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateActionRequest(subscriptionId, resourceGroupName, exadbVmClusterName, exascaleDBNodeName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExascaleDbNode resources by ExadbVmCluster. + /// 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 name of the ExadbVmCluster. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, exadbVmClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExascaleDBNodeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDBNodeListResult.DeserializeExascaleDBNodeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExascaleDbNode resources by ExadbVmCluster. + /// 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 name of the ExadbVmCluster. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, exadbVmClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExascaleDBNodeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDBNodeListResult.DeserializeExascaleDBNodeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbStorageVaultsRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbStorageVaultsRestOperations.cs new file mode 100644 index 000000000000..81b14904c7b7 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbStorageVaultsRestOperations.cs @@ -0,0 +1,723 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class ExascaleDbStorageVaultsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ExascaleDbStorageVaultsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ExascaleDbStorageVaultsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/exascaleDbStorageVaults", 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/Oracle.Database/exascaleDbStorageVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExascaleDbStorageVault resources by subscription ID. + /// 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: + { + ExascaleDBStorageVaultListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDBStorageVaultListResult.DeserializeExascaleDBStorageVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExascaleDbStorageVault resources by subscription ID. + /// 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: + { + ExascaleDBStorageVaultListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDBStorageVaultListResult.DeserializeExascaleDBStorageVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exascaleDbStorageVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exascaleDbStorageVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExascaleDbStorageVault resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExascaleDBStorageVaultListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDBStorageVaultListResult.DeserializeExascaleDBStorageVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExascaleDbStorageVault resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExascaleDBStorageVaultListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDBStorageVaultListResult.DeserializeExascaleDBStorageVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string exascaleDBStorageVaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDBStorageVaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string exascaleDBStorageVaultName) + { + 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/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDBStorageVaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// 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 exascaleDBStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, exascaleDBStorageVaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExascaleDBStorageVaultData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDBStorageVaultData.DeserializeExascaleDBStorageVaultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExascaleDBStorageVaultData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// 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 exascaleDBStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, exascaleDBStorageVaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExascaleDBStorageVaultData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDBStorageVaultData.DeserializeExascaleDBStorageVaultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExascaleDBStorageVaultData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string exascaleDBStorageVaultName, ExascaleDBStorageVaultData 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/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDBStorageVaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string exascaleDBStorageVaultName, ExascaleDBStorageVaultData 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/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDBStorageVaultName, 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 ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// Resource create parameters. + /// 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 exascaleDBStorageVaultName, ExascaleDBStorageVaultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, exascaleDBStorageVaultName, 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); + } + } + + /// Create a ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// Resource create parameters. + /// 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 exascaleDBStorageVaultName, ExascaleDBStorageVaultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, exascaleDBStorageVaultName, 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 exascaleDBStorageVaultName, ExascaleDBStorageVaultPatch 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/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDBStorageVaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string exascaleDBStorageVaultName, ExascaleDBStorageVaultPatch 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/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDBStorageVaultName, 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; + } + + /// Update a ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// The resource properties to be updated. + /// 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 exascaleDBStorageVaultName, ExascaleDBStorageVaultPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, exascaleDBStorageVaultName, 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); + } + } + + /// Update a ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// The resource properties to be updated. + /// 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 exascaleDBStorageVaultName, ExascaleDBStorageVaultPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, exascaleDBStorageVaultName, 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 exascaleDBStorageVaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDBStorageVaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string exascaleDBStorageVaultName) + { + 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/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDBStorageVaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// 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 exascaleDBStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, exascaleDBStorageVaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// 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 exascaleDBStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDBStorageVaultName, nameof(exascaleDBStorageVaultName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, exascaleDBStorageVaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return 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; + } + + /// List ExascaleDbStorageVault resources by subscription ID. + /// 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: + { + ExascaleDBStorageVaultListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDBStorageVaultListResult.DeserializeExascaleDBStorageVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExascaleDbStorageVault resources by subscription ID. + /// 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: + { + ExascaleDBStorageVaultListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDBStorageVaultListResult.DeserializeExascaleDBStorageVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExascaleDbStorageVault resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExascaleDBStorageVaultListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDBStorageVaultListResult.DeserializeExascaleDBStorageVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExascaleDbStorageVault resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExascaleDBStorageVaultListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDBStorageVaultListResult.DeserializeExascaleDBStorageVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/FlexComponentsRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/FlexComponentsRestOperations.cs new file mode 100644 index 000000000000..278b8999e589 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/FlexComponentsRestOperations.cs @@ -0,0 +1,307 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class FlexComponentsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FlexComponentsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public FlexComponentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, AzureLocation location, SystemShape? shape) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/flexComponents", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (shape != null) + { + uri.AppendQuery("shape", shape.Value.ToString(), true); + } + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, AzureLocation location, SystemShape? shape) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/flexComponents", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (shape != null) + { + uri.AppendQuery("shape", shape.Value.ToString(), true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List FlexComponent resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByParentAsync(string subscriptionId, AzureLocation location, SystemShape? shape = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByParentRequest(subscriptionId, location, shape); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FlexComponentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FlexComponentListResult.DeserializeFlexComponentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FlexComponent resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByParent(string subscriptionId, AzureLocation location, SystemShape? shape = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByParentRequest(subscriptionId, location, shape); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FlexComponentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FlexComponentListResult.DeserializeFlexComponentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string flexComponentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/flexComponents/", false); + uri.AppendPath(flexComponentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string flexComponentName) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/flexComponents/", false); + uri.AppendPath(flexComponentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a FlexComponent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The name of the FlexComponent. + /// 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, AzureLocation location, string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var message = CreateGetRequest(subscriptionId, location, flexComponentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FlexComponentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FlexComponentData.DeserializeFlexComponentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FlexComponentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a FlexComponent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The name of the FlexComponent. + /// 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, AzureLocation location, string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var message = CreateGetRequest(subscriptionId, location, flexComponentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FlexComponentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FlexComponentData.DeserializeFlexComponentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FlexComponentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List FlexComponent resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, location, shape); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FlexComponentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FlexComponentListResult.DeserializeFlexComponentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FlexComponent resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByParentNextPage(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, location, shape); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FlexComponentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FlexComponentListResult.DeserializeFlexComponentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiMinorVersionsRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiMinorVersionsRestOperations.cs new file mode 100644 index 000000000000..03ac2cb16440 --- /dev/null +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiMinorVersionsRestOperations.cs @@ -0,0 +1,339 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class GiMinorVersionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of GiMinorVersionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public GiMinorVersionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily, string zone) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/giVersions/", false); + uri.AppendPath(giversionname, true); + uri.AppendPath("/giMinorVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (shapeFamily != null) + { + uri.AppendQuery("shapeFamily", shapeFamily.Value.ToString(), true); + } + if (zone != null) + { + uri.AppendQuery("zone", zone, true); + } + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily, string zone) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/giVersions/", false); + uri.AppendPath(giversionname, true); + uri.AppendPath("/giMinorVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (shapeFamily != null) + { + uri.AppendQuery("shapeFamily", shapeFamily.Value.ToString(), true); + } + if (zone != null) + { + uri.AppendQuery("zone", zone, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List GiMinorVersion resources by GiVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// GiVersion name. + /// If provided, filters the results to the set of database versions which are supported for the given shape family. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByParentAsync(string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily = null, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var message = CreateListByParentRequest(subscriptionId, location, giversionname, shapeFamily, zone); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GiMinorVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GiMinorVersionListResult.DeserializeGiMinorVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List GiMinorVersion resources by GiVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// GiVersion name. + /// If provided, filters the results to the set of database versions which are supported for the given shape family. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByParent(string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily = null, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var message = CreateListByParentRequest(subscriptionId, location, giversionname, shapeFamily, zone); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GiMinorVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GiMinorVersionListResult.DeserializeGiMinorVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string giversionname, string giMinorVersionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/giVersions/", false); + uri.AppendPath(giversionname, true); + uri.AppendPath("/giMinorVersions/", false); + uri.AppendPath(giMinorVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string giversionname, string giMinorVersionName) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/giVersions/", false); + uri.AppendPath(giversionname, true); + uri.AppendPath("/giMinorVersions/", false); + uri.AppendPath(giMinorVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a GiMinorVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// GiVersion name. + /// The name of the GiMinorVersion. + /// 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, AzureLocation location, string giversionname, string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var message = CreateGetRequest(subscriptionId, location, giversionname, giMinorVersionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GiMinorVersionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GiMinorVersionData.DeserializeGiMinorVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GiMinorVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a GiMinorVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// GiVersion name. + /// The name of the GiMinorVersion. + /// 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, AzureLocation location, string giversionname, string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var message = CreateGetRequest(subscriptionId, location, giversionname, giMinorVersionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GiMinorVersionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GiMinorVersionData.DeserializeGiMinorVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GiMinorVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily, string zone) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily, string zone) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List GiMinorVersion resources by GiVersion. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// GiVersion name. + /// If provided, filters the results to the set of database versions which are supported for the given shape family. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily = null, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, location, giversionname, shapeFamily, zone); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GiMinorVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GiMinorVersionListResult.DeserializeGiMinorVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List GiMinorVersion resources by GiVersion. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// GiVersion name. + /// If provided, filters the results to the set of database versions which are supported for the given shape family. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByParentNextPage(string nextLink, string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily = null, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, location, giversionname, shapeFamily, zone); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GiMinorVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GiMinorVersionListResult.DeserializeGiMinorVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiVersionsRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiVersionsRestOperations.cs index d15c336951ca..5f32b201c59b 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiVersionsRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiVersionsRestOperations.cs @@ -32,11 +32,11 @@ public GiVersionsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListByLocationRequestUri(string subscriptionId, AzureLocation location) + internal RequestUriBuilder CreateListByLocationRequestUri(string subscriptionId, AzureLocation location, SystemShape? shape, string zone) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,10 +46,18 @@ internal RequestUriBuilder CreateListByLocationRequestUri(string subscriptionId, uri.AppendPath(location, true); uri.AppendPath("/giVersions", false); uri.AppendQuery("api-version", _apiVersion, true); + if (shape != null) + { + uri.AppendQuery("shape", shape.Value.ToString(), true); + } + if (zone != null) + { + uri.AppendQuery("zone", zone, true); + } return uri; } - internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLocation location) + internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLocation location, SystemShape? shape, string zone) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -62,23 +70,33 @@ internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLoc uri.AppendPath(location, true); uri.AppendPath("/giVersions", false); uri.AppendQuery("api-version", _apiVersion, true); + if (shape != null) + { + uri.AppendQuery("shape", shape.Value.ToString(), true); + } + if (zone != null) + { + uri.AppendQuery("zone", zone, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// List GiVersion resources by Location. + /// List GiVersion resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// Filters the result for the given Azure Availability Zone. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListByLocationAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + public async Task> ListByLocationAsync(string subscriptionId, AzureLocation location, SystemShape? shape = null, string zone = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListByLocationRequest(subscriptionId, location); + using var message = CreateListByLocationRequest(subscriptionId, location, shape, zone); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -94,17 +112,19 @@ public async Task> ListByLocationAsync(string subs } } - /// List GiVersion resources by Location. + /// List GiVersion resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// Filters the result for the given Azure Availability Zone. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public Response ListByLocation(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + public Response ListByLocation(string subscriptionId, AzureLocation location, SystemShape? shape = null, string zone = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListByLocationRequest(subscriptionId, location); + using var message = CreateListByLocationRequest(subscriptionId, location, shape, zone); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -214,7 +234,7 @@ public Response Get(string subscriptionId, AzureLocation lo } } - internal RequestUriBuilder CreateListByLocationNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location) + internal RequestUriBuilder CreateListByLocationNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape, string zone) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -222,7 +242,7 @@ internal RequestUriBuilder CreateListByLocationNextPageRequestUri(string nextLin return uri; } - internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string subscriptionId, AzureLocation location) + internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape, string zone) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -236,19 +256,21 @@ internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string return message; } - /// List GiVersion resources by Location. + /// List GiVersion resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// Filters the result for the given Azure Availability Zone. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListByLocationNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + public async Task> ListByLocationNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape = null, string zone = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location, shape, zone); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -264,19 +286,21 @@ public async Task> ListByLocationNextPageAsync(str } } - /// List GiVersion resources by Location. + /// List GiVersion resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// Filters the result for the given Azure Availability Zone. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. - public Response ListByLocationNextPage(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + public Response ListByLocationNextPage(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape = null, string zone = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location, shape, zone); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/OracleSubscriptionsRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/OracleSubscriptionsRestOperations.cs index e720ff3dfd13..4ccb1f0c447d 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/OracleSubscriptionsRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/OracleSubscriptionsRestOperations.cs @@ -32,7 +32,7 @@ public OracleSubscriptionsRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -422,6 +422,82 @@ public Response Delete(string subscriptionId, CancellationToken cancellationToke } } + internal RequestUriBuilder CreateAddAzureSubscriptionsRequestUri(string subscriptionId, AzureSubscriptions body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/oracleSubscriptions/default/addAzureSubscriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateAddAzureSubscriptionsRequest(string subscriptionId, AzureSubscriptions body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/oracleSubscriptions/default/addAzureSubscriptions", 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; + } + + /// Add Azure Subscriptions. + /// The ID of the target subscription. The value must be an UUID. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task AddAzureSubscriptionsAsync(string subscriptionId, AzureSubscriptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateAddAzureSubscriptionsRequest(subscriptionId, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Add Azure Subscriptions. + /// The ID of the target subscription. The value must be an UUID. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response AddAzureSubscriptions(string subscriptionId, AzureSubscriptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateAddAzureSubscriptionsRequest(subscriptionId, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListActivationLinksRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/SystemVersionsRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/SystemVersionsRestOperations.cs index c40247cb5139..01a748fdd3ad 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/SystemVersionsRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/SystemVersionsRestOperations.cs @@ -32,7 +32,7 @@ public SystemVersionsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -68,7 +68,7 @@ internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLoc return message; } - /// List SystemVersion resources by Location. + /// List SystemVersion resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. /// The cancellation token to use. @@ -94,7 +94,7 @@ public async Task> ListByLocationAsync(string } } - /// List SystemVersion resources by Location. + /// List SystemVersion resources by SubscriptionLocationResource. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. /// The cancellation token to use. @@ -236,7 +236,7 @@ internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string return message; } - /// List SystemVersion resources by Location. + /// List SystemVersion resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. @@ -264,7 +264,7 @@ public async Task> ListByLocationNextPageAsync } } - /// List SystemVersion resources by Location. + /// List SystemVersion resources by SubscriptionLocationResource. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the Azure region. diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/VirtualNetworkAddressesRestOperations.cs b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/VirtualNetworkAddressesRestOperations.cs index 7dae9afb5899..f34f512d8cdc 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/VirtualNetworkAddressesRestOperations.cs +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/VirtualNetworkAddressesRestOperations.cs @@ -32,11 +32,11 @@ public VirtualNetworkAddressesRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-09-01"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListByCloudVmClusterRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername) + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -51,7 +51,7 @@ internal RequestUriBuilder CreateListByCloudVmClusterRequestUri(string subscript return uri; } - internal HttpMessage CreateListByCloudVmClusterRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername) + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -79,13 +79,13 @@ internal HttpMessage CreateListByCloudVmClusterRequest(string subscriptionId, st /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByCloudVmClusterAsync(string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + public async Task> ListByParentAsync(string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); - using var message = CreateListByCloudVmClusterRequest(subscriptionId, resourceGroupName, cloudvmclustername); + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, cloudvmclustername); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -108,13 +108,13 @@ public async Task> ListByCloudVmCluste /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListByCloudVmCluster(string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + public Response ListByParent(string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); - using var message = CreateListByCloudVmClusterRequest(subscriptionId, resourceGroupName, cloudvmclustername); + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, cloudvmclustername); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -426,7 +426,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string c } } - internal RequestUriBuilder CreateListByCloudVmClusterNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername) + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -434,7 +434,7 @@ internal RequestUriBuilder CreateListByCloudVmClusterNextPageRequestUri(string n return uri; } - internal HttpMessage CreateListByCloudVmClusterNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername) + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -456,14 +456,14 @@ internal HttpMessage CreateListByCloudVmClusterNextPageRequest(string nextLink, /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByCloudVmClusterNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); - using var message = CreateListByCloudVmClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudvmclustername); + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudvmclustername); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -487,14 +487,14 @@ public async Task> ListByCloudVmCluste /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListByCloudVmClusterNextPage(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + public Response ListByParentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); - using var message = CreateListByCloudVmClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudvmclustername); + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudvmclustername); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/autorest.md b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/autorest.md index 943d602bc377..d57ae2b7a014 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/autorest.md +++ b/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/autorest.md @@ -7,7 +7,7 @@ azure-arm: true csharp: true library-name: OracleDatabase namespace: Azure.ResourceManager.OracleDatabase -require: https://github.com/Azure/azure-rest-api-specs/blob/ec7ee8842bf615c2f0354bf8b5b8725fdac9454a/specification/oracle/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/242acb7e81d1f9bd566eddf04cf16779a5b02cea/specification/oracle/resource-manager/readme.md #tag: package-2023-09-01 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/Azure.ResourceManager.OracleDatabase.sln b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/Azure.ResourceManager.OracleDatabase.sln new file mode 100644 index 000000000000..ba8ba4c4195b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/Azure.ResourceManager.OracleDatabase.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.OracleDatabase.Samples", "samples\Azure.ResourceManager.OracleDatabase.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.OracleDatabase", "src\Azure.ResourceManager.OracleDatabase.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.OracleDatabase.Tests", "tests\Azure.ResourceManager.OracleDatabase.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/oracledatabase/Azure.ResourceManager.OracleDatabase/CHANGELOG.md b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/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/oracledatabase/Azure.ResourceManager.OracleDatabase/Directory.Build.props b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/README.md b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/README.md new file mode 100644 index 000000000000..077b1ffb6056 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure OracleDatabase 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 OracleDatabase management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.OracleDatabase --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/oracledatabase/Azure.ResourceManager.OracleDatabase/assets.json b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/assets.json new file mode 100644 index 000000000000..fba18acd24f2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/oracledatabase/Azure.ResourceManager.OracleDatabase", + "Tag": "" +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Azure.ResourceManager.OracleDatabase.Samples.csproj b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Azure.ResourceManager.OracleDatabase.Samples.csproj new file mode 100644 index 000000000000..209dab0f893e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Azure.ResourceManager.OracleDatabase.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseBackupResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseBackupResource.cs new file mode 100644 index 000000000000..5bedef33fe95 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseBackupResource.cs @@ -0,0 +1,51 @@ +// 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.OracleDatabase.Samples +{ + public partial class Sample_AutonomousDatabaseBackupResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AutonomousDatabaseBackupsUpdate() + { + // Generated from example definition: 2025-03-01/autonomousDatabaseBackup_patch.json + // this example is just showing the usage of "AutonomousDatabaseBackup_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 AutonomousDatabaseBackupResource created on azure + // for more information of creating AutonomousDatabaseBackupResource, please refer to the document of AutonomousDatabaseBackupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg000"; + string autonomousdatabasename = "databasedb1"; + string adbbackupid = "1711644130"; + ResourceIdentifier autonomousDatabaseBackupResourceId = AutonomousDatabaseBackupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, autonomousdatabasename, adbbackupid); + AutonomousDatabaseBackupResource autonomousDatabaseBackup = client.GetAutonomousDatabaseBackupResource(autonomousDatabaseBackupResourceId); + + // invoke the operation + AutonomousDatabaseBackupData data = new AutonomousDatabaseBackupData(); + ArmOperation lro = await autonomousDatabaseBackup.UpdateAsync(WaitUntil.Completed, data); + AutonomousDatabaseBackupResource 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 + AutonomousDatabaseBackupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseResource.cs new file mode 100644 index 000000000000..7403501f0ba0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_AutonomousDatabaseResource.cs @@ -0,0 +1,188 @@ +// 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.OracleDatabase.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_AutonomousDatabaseResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Switchover_AutonomousDatabasesSwitchover() + { + // Generated from example definition: 2025-03-01/autonomousDatabase_switchover.json + // this example is just showing the usage of "AutonomousDatabases_Switchover" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 AutonomousDatabaseResource created on azure + // for more information of creating AutonomousDatabaseResource, please refer to the document of AutonomousDatabaseResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg000"; + string autonomousdatabasename = "databasedb1"; + ResourceIdentifier autonomousDatabaseResourceId = AutonomousDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, autonomousdatabasename); + AutonomousDatabaseResource autonomousDatabase = client.GetAutonomousDatabaseResource(autonomousDatabaseResourceId); + + // invoke the operation + PeerDbDetails details = new PeerDbDetails + { + PeerDbId = "peerDbId", + }; + ArmOperation lro = await autonomousDatabase.SwitchoverAsync(WaitUntil.Completed, details); + AutonomousDatabaseResource 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 + AutonomousDatabaseData 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 Failover_AutonomousDatabasesFailover() + { + // Generated from example definition: 2025-03-01/autonomousDatabase_failover.json + // this example is just showing the usage of "AutonomousDatabases_Failover" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 AutonomousDatabaseResource created on azure + // for more information of creating AutonomousDatabaseResource, please refer to the document of AutonomousDatabaseResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg000"; + string autonomousdatabasename = "databasedb1"; + ResourceIdentifier autonomousDatabaseResourceId = AutonomousDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, autonomousdatabasename); + AutonomousDatabaseResource autonomousDatabase = client.GetAutonomousDatabaseResource(autonomousDatabaseResourceId); + + // invoke the operation + PeerDbDetails details = new PeerDbDetails + { + PeerDbId = "peerDbId", + }; + ArmOperation lro = await autonomousDatabase.FailoverAsync(WaitUntil.Completed, details); + AutonomousDatabaseResource 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 + AutonomousDatabaseData 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 GenerateWallet_AutonomousDatabasesGenerateWallet() + { + // Generated from example definition: 2025-03-01/autonomousDatabase_generateWallet.json + // this example is just showing the usage of "AutonomousDatabases_GenerateWallet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 AutonomousDatabaseResource created on azure + // for more information of creating AutonomousDatabaseResource, please refer to the document of AutonomousDatabaseResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg000"; + string autonomousdatabasename = "databasedb1"; + ResourceIdentifier autonomousDatabaseResourceId = AutonomousDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, autonomousdatabasename); + AutonomousDatabaseResource autonomousDatabase = client.GetAutonomousDatabaseResource(autonomousDatabaseResourceId); + + // invoke the operation + GenerateAutonomousDatabaseWalletDetails details = new GenerateAutonomousDatabaseWalletDetails("********") + { + GenerateType = GenerateType.Single, + IsRegional = false, + }; + AutonomousDatabaseWalletFile result = await autonomousDatabase.GenerateWalletAsync(details); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Restore_AutonomousDatabasesRestore() + { + // Generated from example definition: 2025-03-01/autonomousDatabase_restore.json + // this example is just showing the usage of "AutonomousDatabases_Restore" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 AutonomousDatabaseResource created on azure + // for more information of creating AutonomousDatabaseResource, please refer to the document of AutonomousDatabaseResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg000"; + string autonomousdatabasename = "databasedb1"; + ResourceIdentifier autonomousDatabaseResourceId = AutonomousDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, autonomousdatabasename); + AutonomousDatabaseResource autonomousDatabase = client.GetAutonomousDatabaseResource(autonomousDatabaseResourceId); + + // invoke the operation + RestoreAutonomousDatabaseDetails details = new RestoreAutonomousDatabaseDetails(DateTimeOffset.Parse("2024-04-23T00:00:00.000Z")); + ArmOperation lro = await autonomousDatabase.RestoreAsync(WaitUntil.Completed, details); + AutonomousDatabaseResource 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 + AutonomousDatabaseData 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 ChangeDisasterRecoveryConfiguration_AutonomousDatabasesChangeDisasterRecoveryConfiguration() + { + // Generated from example definition: 2025-03-01/autonomousDatabase_changeDisasterRecoveryConfiguration.json + // this example is just showing the usage of "AutonomousDatabases_ChangeDisasterRecoveryConfiguration" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 AutonomousDatabaseResource created on azure + // for more information of creating AutonomousDatabaseResource, please refer to the document of AutonomousDatabaseResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg000"; + string autonomousdatabasename = "databasedb1"; + ResourceIdentifier autonomousDatabaseResourceId = AutonomousDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, autonomousdatabasename); + AutonomousDatabaseResource autonomousDatabase = client.GetAutonomousDatabaseResource(autonomousDatabaseResourceId); + + // invoke the operation + DisasterRecoveryConfigurationDetails details = new DisasterRecoveryConfigurationDetails + { + DisasterRecoveryType = DisasterRecoveryType.Adg, + IsReplicateAutomaticBackups = false, + }; + ArmOperation lro = await autonomousDatabase.ChangeDisasterRecoveryConfigurationAsync(WaitUntil.Completed, details); + AutonomousDatabaseResource 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 + AutonomousDatabaseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudExadataInfrastructureResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudExadataInfrastructureResource.cs new file mode 100644 index 000000000000..fb1720e1c2c0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudExadataInfrastructureResource.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.OracleDatabase.Samples +{ + public partial class Sample_CloudExadataInfrastructureResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task AddStorageCapacity_CloudExadataInfrastructuresAddStorageCapacity() + { + // Generated from example definition: 2025-03-01/exaInfra_addStorageCapacity.json + // this example is just showing the usage of "CloudExadataInfrastructures_AddStorageCapacity" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CloudExadataInfrastructureResource created on azure + // for more information of creating CloudExadataInfrastructureResource, please refer to the document of CloudExadataInfrastructureResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg000"; + string cloudexadatainfrastructurename = "infra1"; + ResourceIdentifier cloudExadataInfrastructureResourceId = CloudExadataInfrastructureResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + CloudExadataInfrastructureResource cloudExadataInfrastructure = client.GetCloudExadataInfrastructureResource(cloudExadataInfrastructureResourceId); + + // invoke the operation + ArmOperation lro = await cloudExadataInfrastructure.AddStorageCapacityAsync(WaitUntil.Completed); + CloudExadataInfrastructureResource 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 + CloudExadataInfrastructureData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterResource.cs new file mode 100644 index 000000000000..f5eaf90eeaf1 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_CloudVmClusterResource.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.OracleDatabase.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_CloudVmClusterResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task AddVms_CloudVmClustersAddVms() + { + // Generated from example definition: 2025-03-01/vmClusters_addVms.json + // this example is just showing the usage of "CloudVmClusters_AddVms" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CloudVmClusterResource created on azure + // for more information of creating CloudVmClusterResource, please refer to the document of CloudVmClusterResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg000"; + string cloudvmclustername = "cluster1"; + ResourceIdentifier cloudVmClusterResourceId = CloudVmClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, cloudvmclustername); + CloudVmClusterResource cloudVmCluster = client.GetCloudVmClusterResource(cloudVmClusterResourceId); + + // invoke the operation + AddRemoveDbNode body = new AddRemoveDbNode(new string[] { "ocid1..aaaa", "ocid1..aaaaaa" }); + ArmOperation lro = await cloudVmCluster.AddVmsAsync(WaitUntil.Completed, body); + CloudVmClusterResource 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 + CloudVmClusterData 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 RemoveVms_CloudVmClustersRemoveVms() + { + // Generated from example definition: 2025-03-01/vmClusters_removeVms.json + // this example is just showing the usage of "CloudVmClusters_RemoveVms" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CloudVmClusterResource created on azure + // for more information of creating CloudVmClusterResource, please refer to the document of CloudVmClusterResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg000"; + string cloudvmclustername = "cluster1"; + ResourceIdentifier cloudVmClusterResourceId = CloudVmClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, cloudvmclustername); + CloudVmClusterResource cloudVmCluster = client.GetCloudVmClusterResource(cloudVmClusterResourceId); + + // invoke the operation + AddRemoveDbNode body = new AddRemoveDbNode(new string[] { "ocid1..aaaa" }); + ArmOperation lro = await cloudVmCluster.RemoveVmsAsync(WaitUntil.Completed, body); + CloudVmClusterResource 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 + CloudVmClusterData 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 GetPrivateIPAddresses_CloudVmClustersListPrivateIpAddresses() + { + // Generated from example definition: 2025-03-01/vmClusters_listPrivateIpAddresses.json + // this example is just showing the usage of "CloudVmClusters_ListPrivateIPAddresses" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 CloudVmClusterResource created on azure + // for more information of creating CloudVmClusterResource, please refer to the document of CloudVmClusterResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg000"; + string cloudvmclustername = "cluster1"; + ResourceIdentifier cloudVmClusterResourceId = CloudVmClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, cloudvmclustername); + CloudVmClusterResource cloudVmCluster = client.GetCloudVmClusterResource(cloudVmClusterResourceId); + + // invoke the operation and iterate over the result + PrivateIPAddressesFilter body = new PrivateIPAddressesFilter("ocid1..aaaaaa", "ocid1..aaaaa"); + await foreach (PrivateIPAddressProperties item in cloudVmCluster.GetPrivateIPAddressesAsync(body)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_DbNodeResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_DbNodeResource.cs new file mode 100644 index 000000000000..2638a6449ccc --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_DbNodeResource.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.OracleDatabase.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_DbNodeResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Action_DbNodesAction() + { + // Generated from example definition: 2025-03-01/dbNodes_action.json + // this example is just showing the usage of "DbNodes_Action" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 DbNodeResource created on azure + // for more information of creating DbNodeResource, please refer to the document of DbNodeResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg000"; + string cloudvmclustername = "cluster1"; + string dbnodeocid = "ocid1....aaaaaa"; + ResourceIdentifier dbNodeResourceId = DbNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, cloudvmclustername, dbnodeocid); + DbNodeResource dbNode = client.GetDbNodeResource(dbNodeResourceId); + + // invoke the operation + DbNodeAction body = new DbNodeAction(DbNodeActionEnum.Start); + ArmOperation lro = await dbNode.ActionAsync(WaitUntil.Completed, body); + DbNodeResource 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 + DbNodeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_DbSystemShapeCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_DbSystemShapeCollection.cs new file mode 100644 index 000000000000..dbe42a983825 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_DbSystemShapeCollection.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_DbSystemShapeCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_DbSystemShapesListByLocation() + { + // Generated from example definition: 2025-03-01/dbSystemShapes_listByLocation.json + // this example is just showing the usage of "DbSystemShape_ListByLocation" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + 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 = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this DbSystemShapeResource + AzureLocation location = new AzureLocation("eastus"); + DbSystemShapeCollection collection = subscriptionResource.GetDbSystemShapes(location); + + // invoke the operation and iterate over the result + await foreach (DbSystemShapeResource 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 + DbSystemShapeData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExadbVmClusterResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExadbVmClusterResource.cs new file mode 100644 index 000000000000..92f60b52cd6e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExadbVmClusterResource.cs @@ -0,0 +1,54 @@ +// 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.OracleDatabase.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_ExadbVmClusterResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task RemoveVms_ExadbVmClustersRemoveVmsMaximumSet() + { + // Generated from example definition: 2025-03-01/ExadbVmClusters_RemoveVms_MaximumSet_Gen.json + // this example is just showing the usage of "ExadbVmClusters_RemoveVms" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 ExadbVmClusterResource created on azure + // for more information of creating ExadbVmClusterResource, please refer to the document of ExadbVmClusterResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exadbVmClusterName = "vmClusterName"; + ResourceIdentifier exadbVmClusterResourceId = ExadbVmClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exadbVmClusterName); + ExadbVmClusterResource exadbVmCluster = client.GetExadbVmClusterResource(exadbVmClusterResourceId); + + // invoke the operation + RemoveVirtualMachineFromExadbVmClusterDetails details = new RemoveVirtualMachineFromExadbVmClusterDetails(new DbNodeDetails[] + { +new DbNodeDetails(new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Oracle.Database/exadbVmClusters/vmCluster/dbNodes/dbNodeName")) + }); + ArmOperation lro = await exadbVmCluster.RemoveVmsAsync(WaitUntil.Completed, details); + ExadbVmClusterResource 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 + ExadbVmClusterData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbNodeCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbNodeCollection.cs new file mode 100644 index 000000000000..10cf7a95a101 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbNodeCollection.cs @@ -0,0 +1,54 @@ +// 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.OracleDatabase.Samples +{ + public partial class Sample_ExascaleDbNodeCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ExascaleDbNodesListByParentMaximumSet() + { + // Generated from example definition: 2025-03-01/ExascaleDbNodes_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbNode_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 ExadbVmClusterResource created on azure + // for more information of creating ExadbVmClusterResource, please refer to the document of ExadbVmClusterResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exadbVmClusterName = "vmClusterName"; + ResourceIdentifier exadbVmClusterResourceId = ExadbVmClusterResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exadbVmClusterName); + ExadbVmClusterResource exadbVmCluster = client.GetExadbVmClusterResource(exadbVmClusterResourceId); + + // get the collection of this ExascaleDbNodeResource + ExascaleDbNodeCollection collection = exadbVmCluster.GetExascaleDbNodes(); + + // invoke the operation and iterate over the result + await foreach (ExascaleDbNodeResource 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 + ExascaleDbNodeData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbNodeResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbNodeResource.cs new file mode 100644 index 000000000000..4ffe56124708 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbNodeResource.cs @@ -0,0 +1,48 @@ +// 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.OracleDatabase.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_ExascaleDbNodeResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Action_ExascaleDbNodesActionMaximumSet() + { + // Generated from example definition: 2025-03-01/ExascaleDbNodes_Action_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbNodes_Action" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 ExascaleDbNodeResource created on azure + // for more information of creating ExascaleDbNodeResource, please refer to the document of ExascaleDbNodeResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exadbVmClusterName = "vmClusterName"; + string exascaleDbNodeName = "dbNodeName"; + ResourceIdentifier exascaleDbNodeResourceId = ExascaleDbNodeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exadbVmClusterName, exascaleDbNodeName); + ExascaleDbNodeResource exascaleDbNode = client.GetExascaleDbNodeResource(exascaleDbNodeResourceId); + + // invoke the operation + DbNodeAction body = new DbNodeAction(DbNodeActionEnum.Start); + ArmOperation lro = await exascaleDbNode.ActionAsync(WaitUntil.Completed, body); + DbActionResponse result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbStorageVaultCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbStorageVaultCollection.cs new file mode 100644 index 000000000000..a64a68ef1f43 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbStorageVaultCollection.cs @@ -0,0 +1,206 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_ExascaleDbStorageVaultCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_ExascaleDbStorageVaultsCreateMaximumSet() + { + // Generated from example definition: 2025-03-01/ExascaleDbStorageVaults_Create_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVault_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExascaleDbStorageVaultResource + ExascaleDbStorageVaultCollection collection = resourceGroupResource.GetExascaleDbStorageVaults(); + + // invoke the operation + string exascaleDbStorageVaultName = "vmClusterName"; + ExascaleDbStorageVaultData data = new ExascaleDbStorageVaultData(new AzureLocation("ltguhzffucaytqg")) + { + Properties = new ExascaleDbStorageVaultProperties("hbsybtelyvhpalemszcvartlhwvskrnpiveqfblvkdihoytqaotdgsgauvgivzaftfgeiwlyeqzssicwrrnlxtsmeakbcsxabjlt", new ExascaleDbStorageInputDetails(21)) + { + AdditionalFlashCacheInPercent = 0, + Description = "dmnvnnduldfmrmkkvvsdtuvmsmruxzzpsfdydgytlckutfozephjygjetrauvbdfcwmti", + TimeZone = "ltrbozwxjunncicrtzjrpqnqrcjgghohztrdlbfjrbkpenopyldwolslwgrgumjfkyovvkzcuxjujuxtjjzubvqvnhrswnbdgcbslopeofmtepbrrlymqwwszvsglmyuvlcuejshtpokirwklnwpcykhyinjmlqvxtyixlthtdishhmtipbygsayvgqzfrprgppylydlcskbmvwctxifdltippfvsxiughqbojqpqrekxsotnqsk", + }, + Zones = { "qk" }, + Tags = +{ +["key7827"] = "xqi" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, exascaleDbStorageVaultName, data); + ExascaleDbStorageVaultResource 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 + ExascaleDbStorageVaultData 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_ExascaleDbStorageVaultsGetMaximumSet() + { + // Generated from example definition: 2025-03-01/ExascaleDbStorageVaults_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVault_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExascaleDbStorageVaultResource + ExascaleDbStorageVaultCollection collection = resourceGroupResource.GetExascaleDbStorageVaults(); + + // invoke the operation + string exascaleDbStorageVaultName = "vmClusterName"; + ExascaleDbStorageVaultResource result = await collection.GetAsync(exascaleDbStorageVaultName); + + // 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 + ExascaleDbStorageVaultData 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_ExascaleDbStorageVaultsListByResourceGroupMaximumSet() + { + // Generated from example definition: 2025-03-01/ExascaleDbStorageVaults_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVault_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExascaleDbStorageVaultResource + ExascaleDbStorageVaultCollection collection = resourceGroupResource.GetExascaleDbStorageVaults(); + + // invoke the operation and iterate over the result + await foreach (ExascaleDbStorageVaultResource 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 + ExascaleDbStorageVaultData 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_ExascaleDbStorageVaultsGetMaximumSet() + { + // Generated from example definition: 2025-03-01/ExascaleDbStorageVaults_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVault_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExascaleDbStorageVaultResource + ExascaleDbStorageVaultCollection collection = resourceGroupResource.GetExascaleDbStorageVaults(); + + // invoke the operation + string exascaleDbStorageVaultName = "vmClusterName"; + bool result = await collection.ExistsAsync(exascaleDbStorageVaultName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_ExascaleDbStorageVaultsGetMaximumSet() + { + // Generated from example definition: 2025-03-01/ExascaleDbStorageVaults_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVault_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 = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ExascaleDbStorageVaultResource + ExascaleDbStorageVaultCollection collection = resourceGroupResource.GetExascaleDbStorageVaults(); + + // invoke the operation + string exascaleDbStorageVaultName = "vmClusterName"; + NullableResponse response = await collection.GetIfExistsAsync(exascaleDbStorageVaultName); + ExascaleDbStorageVaultResource 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 + ExascaleDbStorageVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbStorageVaultResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbStorageVaultResource.cs new file mode 100644 index 000000000000..c5b32761fd62 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_ExascaleDbStorageVaultResource.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.OracleDatabase.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_ExascaleDbStorageVaultResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_ExascaleDbStorageVaultsGetMaximumSet() + { + // Generated from example definition: 2025-03-01/ExascaleDbStorageVaults_Get_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVault_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 ExascaleDbStorageVaultResource created on azure + // for more information of creating ExascaleDbStorageVaultResource, please refer to the document of ExascaleDbStorageVaultResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exascaleDbStorageVaultName = "vmClusterName"; + ResourceIdentifier exascaleDbStorageVaultResourceId = ExascaleDbStorageVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exascaleDbStorageVaultName); + ExascaleDbStorageVaultResource exascaleDbStorageVault = client.GetExascaleDbStorageVaultResource(exascaleDbStorageVaultResourceId); + + // invoke the operation + ExascaleDbStorageVaultResource result = await exascaleDbStorageVault.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 + ExascaleDbStorageVaultData 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_ExascaleDbStorageVaultsDeleteMaximumSet() + { + // Generated from example definition: 2025-03-01/ExascaleDbStorageVaults_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVault_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 ExascaleDbStorageVaultResource created on azure + // for more information of creating ExascaleDbStorageVaultResource, please refer to the document of ExascaleDbStorageVaultResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exascaleDbStorageVaultName = "vmClusterName"; + ResourceIdentifier exascaleDbStorageVaultResourceId = ExascaleDbStorageVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exascaleDbStorageVaultName); + ExascaleDbStorageVaultResource exascaleDbStorageVault = client.GetExascaleDbStorageVaultResource(exascaleDbStorageVaultResourceId); + + // invoke the operation + await exascaleDbStorageVault.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_ExascaleDbStorageVaultsUpdateMaximumSet() + { + // Generated from example definition: 2025-03-01/ExascaleDbStorageVaults_Update_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVault_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 ExascaleDbStorageVaultResource created on azure + // for more information of creating ExascaleDbStorageVaultResource, please refer to the document of ExascaleDbStorageVaultResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rgopenapi"; + string exascaleDbStorageVaultName = "vmClusterName"; + ResourceIdentifier exascaleDbStorageVaultResourceId = ExascaleDbStorageVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, exascaleDbStorageVaultName); + ExascaleDbStorageVaultResource exascaleDbStorageVault = client.GetExascaleDbStorageVaultResource(exascaleDbStorageVaultResourceId); + + // invoke the operation + ExascaleDbStorageVaultPatch patch = new ExascaleDbStorageVaultPatch + { + Tags = +{ +["key6179"] = "ouj" +}, + }; + ArmOperation lro = await exascaleDbStorageVault.UpdateAsync(WaitUntil.Completed, patch); + ExascaleDbStorageVaultResource 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 + ExascaleDbStorageVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentCollection.cs new file mode 100644 index 000000000000..51902c849622 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentCollection.cs @@ -0,0 +1,159 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_FlexComponentCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FlexComponentsGetMaximumSet() + { + // Generated from example definition: 2025-03-01/FlexComponents_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FlexComponent_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this FlexComponentResource + AzureLocation location = new AzureLocation("eastus"); + FlexComponentCollection collection = subscriptionResource.GetFlexComponents(location); + + // invoke the operation + string flexComponentName = "flexComponent"; + FlexComponentResource result = await collection.GetAsync(flexComponentName); + + // 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 + FlexComponentData 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_FlexComponentsListByParentMaximumSet() + { + // Generated from example definition: 2025-03-01/FlexComponents_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "FlexComponent_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this FlexComponentResource + AzureLocation location = new AzureLocation("eastus"); + FlexComponentCollection collection = subscriptionResource.GetFlexComponents(location); + + // invoke the operation and iterate over the result + SystemShape? shape = SystemShape.ExadataX11M; + await foreach (FlexComponentResource item in collection.GetAllAsync(shape: shape)) + { + // 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 + FlexComponentData 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_FlexComponentsGetMaximumSet() + { + // Generated from example definition: 2025-03-01/FlexComponents_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FlexComponent_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this FlexComponentResource + AzureLocation location = new AzureLocation("eastus"); + FlexComponentCollection collection = subscriptionResource.GetFlexComponents(location); + + // invoke the operation + string flexComponentName = "flexComponent"; + bool result = await collection.ExistsAsync(flexComponentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_FlexComponentsGetMaximumSet() + { + // Generated from example definition: 2025-03-01/FlexComponents_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FlexComponent_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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this FlexComponentResource + AzureLocation location = new AzureLocation("eastus"); + FlexComponentCollection collection = subscriptionResource.GetFlexComponents(location); + + // invoke the operation + string flexComponentName = "flexComponent"; + NullableResponse response = await collection.GetIfExistsAsync(flexComponentName); + FlexComponentResource 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 + FlexComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentResource.cs new file mode 100644 index 000000000000..61cc055d34a0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_FlexComponentResource.cs @@ -0,0 +1,48 @@ +// 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.OracleDatabase.Samples +{ + public partial class Sample_FlexComponentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FlexComponentsGetMaximumSet() + { + // Generated from example definition: 2025-03-01/FlexComponents_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FlexComponent_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 FlexComponentResource created on azure + // for more information of creating FlexComponentResource, please refer to the document of FlexComponentResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + AzureLocation location = new AzureLocation("eastus"); + string flexComponentName = "flexComponent"; + ResourceIdentifier flexComponentResourceId = FlexComponentResource.CreateResourceIdentifier(subscriptionId, location, flexComponentName); + FlexComponentResource flexComponent = client.GetFlexComponentResource(flexComponentResourceId); + + // invoke the operation + FlexComponentResource result = await flexComponent.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 + FlexComponentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionCollection.cs new file mode 100644 index 000000000000..ee7571123c1a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionCollection.cs @@ -0,0 +1,162 @@ +// 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.OracleDatabase.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_GiMinorVersionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GiMinorVersionsGetMaximumSet() + { + // Generated from example definition: 2025-03-01/GiMinorVersions_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GiMinorVersion_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 GiVersionResource created on azure + // for more information of creating GiVersionResource, please refer to the document of GiVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + AzureLocation location = new AzureLocation("eastus"); + string giversionname = "giVersionName"; + ResourceIdentifier giVersionResourceId = GiVersionResource.CreateResourceIdentifier(subscriptionId, location, giversionname); + GiVersionResource giVersion = client.GetGiVersionResource(giVersionResourceId); + + // get the collection of this GiMinorVersionResource + GiMinorVersionCollection collection = giVersion.GetGiMinorVersions(); + + // invoke the operation + string giMinorVersionName = "giMinorVersionName"; + GiMinorVersionResource result = await collection.GetAsync(giMinorVersionName); + + // 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 + GiMinorVersionData 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_GiMinorVersionsListByParentMaximumSet() + { + // Generated from example definition: 2025-03-01/GiMinorVersions_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "GiMinorVersion_ListByParent" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 GiVersionResource created on azure + // for more information of creating GiVersionResource, please refer to the document of GiVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + AzureLocation location = new AzureLocation("eastus"); + string giversionname = "giVersionName"; + ResourceIdentifier giVersionResourceId = GiVersionResource.CreateResourceIdentifier(subscriptionId, location, giversionname); + GiVersionResource giVersion = client.GetGiVersionResource(giVersionResourceId); + + // get the collection of this GiMinorVersionResource + GiMinorVersionCollection collection = giVersion.GetGiMinorVersions(); + + // invoke the operation and iterate over the result + ShapeFamily? shapeFamily = new ShapeFamily("rtfcosvtlpeeqoicsjqggtgc"); + await foreach (GiMinorVersionResource item in collection.GetAllAsync(shapeFamily: shapeFamily)) + { + // 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 + GiMinorVersionData 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_GiMinorVersionsGetMaximumSet() + { + // Generated from example definition: 2025-03-01/GiMinorVersions_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GiMinorVersion_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 GiVersionResource created on azure + // for more information of creating GiVersionResource, please refer to the document of GiVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + AzureLocation location = new AzureLocation("eastus"); + string giversionname = "giVersionName"; + ResourceIdentifier giVersionResourceId = GiVersionResource.CreateResourceIdentifier(subscriptionId, location, giversionname); + GiVersionResource giVersion = client.GetGiVersionResource(giVersionResourceId); + + // get the collection of this GiMinorVersionResource + GiMinorVersionCollection collection = giVersion.GetGiMinorVersions(); + + // invoke the operation + string giMinorVersionName = "giMinorVersionName"; + bool result = await collection.ExistsAsync(giMinorVersionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GiMinorVersionsGetMaximumSet() + { + // Generated from example definition: 2025-03-01/GiMinorVersions_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GiMinorVersion_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 GiVersionResource created on azure + // for more information of creating GiVersionResource, please refer to the document of GiVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + AzureLocation location = new AzureLocation("eastus"); + string giversionname = "giVersionName"; + ResourceIdentifier giVersionResourceId = GiVersionResource.CreateResourceIdentifier(subscriptionId, location, giversionname); + GiVersionResource giVersion = client.GetGiVersionResource(giVersionResourceId); + + // get the collection of this GiMinorVersionResource + GiMinorVersionCollection collection = giVersion.GetGiMinorVersions(); + + // invoke the operation + string giMinorVersionName = "giMinorVersionName"; + NullableResponse response = await collection.GetIfExistsAsync(giMinorVersionName); + GiMinorVersionResource 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 + GiMinorVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionResource.cs new file mode 100644 index 000000000000..2b9b6795bf06 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiMinorVersionResource.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.OracleDatabase.Samples +{ + public partial class Sample_GiMinorVersionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GiMinorVersionsGetMaximumSet() + { + // Generated from example definition: 2025-03-01/GiMinorVersions_Get_MaximumSet_Gen.json + // this example is just showing the usage of "GiMinorVersion_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 GiMinorVersionResource created on azure + // for more information of creating GiMinorVersionResource, please refer to the document of GiMinorVersionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + AzureLocation location = new AzureLocation("eastus"); + string giversionname = "giVersionName"; + string giMinorVersionName = "giMinorVersionName"; + ResourceIdentifier giMinorVersionResourceId = GiMinorVersionResource.CreateResourceIdentifier(subscriptionId, location, giversionname, giMinorVersionName); + GiMinorVersionResource giMinorVersion = client.GetGiMinorVersionResource(giMinorVersionResourceId); + + // invoke the operation + GiMinorVersionResource result = await giMinorVersion.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 + GiMinorVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiVersionCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiVersionCollection.cs new file mode 100644 index 000000000000..e80282236f47 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_GiVersionCollection.cs @@ -0,0 +1,91 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_GiVersionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListGiVersionsByLocationGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-03-01/GiVersions_ListByLocation_MaximumSet_Gen.json + // this example is just showing the usage of "GiVersion_ListByLocation" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + 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 = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this GiVersionResource + AzureLocation location = new AzureLocation("eastus"); + GiVersionCollection collection = subscriptionResource.GetGiVersions(location); + + // invoke the operation and iterate over the result + SystemShape? shape = new SystemShape("osixsklyaauhoqnkxvnvsqeqenhzogntqnpubldrrfvqncwetdtwqwjjcvspwhgecbimdlulwcubikebrdzmidrucgtsuqvytkqutmbyrvvyioxpocpmuwiivyanjzucaegihztluuvpznzaoakfsselumhhsvrtrbzwpjhcihsvyouonlxdluwhqfxoqvgthkaxppbydtqjntscgzbivfdcaobbkthrbdjwpejirqmbly"); + await foreach (GiVersionResource item in collection.GetAllAsync(shape: shape)) + { + // 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 + GiVersionData 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 GetAll_ListGiVersionsByLocationGeneratedByMinimumSetRule() + { + // Generated from example definition: 2025-03-01/GiVersions_ListByLocation_MinimumSet_Gen.json + // this example is just showing the usage of "GiVersion_ListByLocation" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + 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 = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this GiVersionResource + AzureLocation location = new AzureLocation("eastus"); + GiVersionCollection collection = subscriptionResource.GetGiVersions(location); + + // invoke the operation and iterate over the result + await foreach (GiVersionResource 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 + GiVersionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSubscriptionResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSubscriptionResource.cs new file mode 100644 index 000000000000..c1560756ea2d --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_OracleSubscriptionResource.cs @@ -0,0 +1,146 @@ +// 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.OracleDatabase.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_OracleSubscriptionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_OracleSubscriptionsUpdate() + { + // Generated from example definition: 2025-03-01/oracleSubscriptions_patch.json + // this example is just showing the usage of "OracleSubscription_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 OracleSubscriptionResource created on azure + // for more information of creating OracleSubscriptionResource, please refer to the document of OracleSubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier oracleSubscriptionResourceId = OracleSubscriptionResource.CreateResourceIdentifier(subscriptionId); + OracleSubscriptionResource oracleSubscription = client.GetOracleSubscriptionResource(oracleSubscriptionResourceId); + + // invoke the operation + OracleSubscriptionPatch patch = new OracleSubscriptionPatch(); + ArmOperation lro = await oracleSubscription.UpdateAsync(WaitUntil.Completed, patch); + OracleSubscriptionResource 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 + OracleSubscriptionData 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 GetCloudAccountDetails_OracleSubscriptionsListCloudAccountDetails() + { + // Generated from example definition: 2025-03-01/oracleSubscriptions_listCloudAccountDetails.json + // this example is just showing the usage of "OracleSubscriptions_ListCloudAccountDetails" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 OracleSubscriptionResource created on azure + // for more information of creating OracleSubscriptionResource, please refer to the document of OracleSubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier oracleSubscriptionResourceId = OracleSubscriptionResource.CreateResourceIdentifier(subscriptionId); + OracleSubscriptionResource oracleSubscription = client.GetOracleSubscriptionResource(oracleSubscriptionResourceId); + + // invoke the operation + await oracleSubscription.GetCloudAccountDetailsAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSaasSubscriptionDetails_OracleSubscriptionsListSaasSubscriptionDetails() + { + // Generated from example definition: 2025-03-01/oracleSubscriptions_listSaasSubscriptionDetails.json + // this example is just showing the usage of "OracleSubscriptions_ListSaasSubscriptionDetails" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 OracleSubscriptionResource created on azure + // for more information of creating OracleSubscriptionResource, please refer to the document of OracleSubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier oracleSubscriptionResourceId = OracleSubscriptionResource.CreateResourceIdentifier(subscriptionId); + OracleSubscriptionResource oracleSubscription = client.GetOracleSubscriptionResource(oracleSubscriptionResourceId); + + // invoke the operation + await oracleSubscription.GetSaasSubscriptionDetailsAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetActivationLinks_OracleSubscriptionsListActivationLinks() + { + // Generated from example definition: 2025-03-01/oracleSubscriptions_listActivationLinks.json + // this example is just showing the usage of "OracleSubscriptions_ListActivationLinks" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 OracleSubscriptionResource created on azure + // for more information of creating OracleSubscriptionResource, please refer to the document of OracleSubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier oracleSubscriptionResourceId = OracleSubscriptionResource.CreateResourceIdentifier(subscriptionId); + OracleSubscriptionResource oracleSubscription = client.GetOracleSubscriptionResource(oracleSubscriptionResourceId); + + // invoke the operation + await oracleSubscription.GetActivationLinksAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task AddAzureSubscriptions_OracleSubscriptionsAddAzureSubscriptions() + { + // Generated from example definition: 2025-03-01/oracleSubscriptions_addAzureSubscriptions.json + // this example is just showing the usage of "OracleSubscriptions_AddAzureSubscriptions" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details 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 OracleSubscriptionResource created on azure + // for more information of creating OracleSubscriptionResource, please refer to the document of OracleSubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier oracleSubscriptionResourceId = OracleSubscriptionResource.CreateResourceIdentifier(subscriptionId); + OracleSubscriptionResource oracleSubscription = client.GetOracleSubscriptionResource(oracleSubscriptionResourceId); + + // invoke the operation + AzureSubscriptions body = new AzureSubscriptions(new string[] { "00000000-0000-0000-0000-000000000001" }); + await oracleSubscription.AddAzureSubscriptionsAsync(WaitUntil.Completed, body); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..6dcc0a48cbe0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.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 Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.OracleDatabase.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetExascaleDbStorageVaults_ExascaleDbStorageVaultsListBySubscriptionMaximumSet() + { + // Generated from example definition: 2025-03-01/ExascaleDbStorageVaults_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "ExascaleDbStorageVault_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 = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (ExascaleDbStorageVaultResource item in subscriptionResource.GetExascaleDbStorageVaultsAsync()) + { + // 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 + ExascaleDbStorageVaultData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Azure.ResourceManager.OracleDatabase.csproj b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Azure.ResourceManager.OracleDatabase.csproj new file mode 100644 index 000000000000..e7f8f39476b1 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Azure.ResourceManager.OracleDatabase.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider OracleDatabase. + 1.0.0-beta.1 + azure;management;arm;resource manager;oracledatabase + Azure.ResourceManager.OracleDatabase + + diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ArmOracleDatabaseModelFactory.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ArmOracleDatabaseModelFactory.cs new file mode 100644 index 000000000000..d7300ebe4ef3 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ArmOracleDatabaseModelFactory.cs @@ -0,0 +1,2267 @@ +// 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.OracleDatabase.Models +{ + /// Model factory for models. + public static partial class ArmOracleDatabaseModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// CloudExadataInfrastructure zones. + /// A new instance for mocking. + public static CloudExadataInfrastructureData CloudExadataInfrastructureData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CloudExadataInfrastructureProperties properties = null, IEnumerable zones = null) + { + tags ??= new Dictionary(); + zones ??= new List(); + + return new CloudExadataInfrastructureData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + zones?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Defined file system configurations. + /// Exadata infra ocid. + /// The number of compute servers for the cloud Exadata infrastructure. + /// The number of storage servers for the cloud Exadata infrastructure. + /// The total storage allocated to the cloud Exadata infrastructure resource, in gigabytes (GB). + /// The available storage can be allocated to the cloud Exadata infrastructure resource, in gigabytes (GB). + /// The date and time the cloud Exadata infrastructure resource was created. + /// Additional information about the current lifecycle state. + /// maintenanceWindow property. + /// The estimated total time required in minutes for all patching operations (database server, storage server, and network switch patching). + /// The list of customer email addresses that receive information from Oracle about the specified OCI Database service resource. Oracle uses these email addresses to send notifications about planned and unplanned software maintenance updates, information about system hardware, and other information needed by administrators. Up to 10 email addresses can be added to the customer contacts for a cloud Exadata infrastructure instance. + /// CloudExadataInfrastructure provisioning state. + /// CloudExadataInfrastructure lifecycle state. + /// The model name of the cloud Exadata infrastructure resource. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// The total number of CPU cores allocated. + /// The total number of CPU cores available. + /// The memory allocated in GBs. + /// The total memory available in GBs. + /// The local node storage to be allocated in GBs. + /// The total local node storage available in GBs. + /// The quantity of data in the database, in terabytes. + /// The total available DATA disk group size. + /// The software version of the database servers (dom0) in the Exadata infrastructure. + /// The software version of the storage servers (cells) in the Exadata infrastructure. + /// The requested number of additional storage servers activated for the Exadata infrastructure. + /// The requested number of additional storage servers for the Exadata infrastructure. + /// The name for the Exadata infrastructure. + /// The OCID of the last maintenance run. + /// The OCID of the next maintenance run. + /// Monthly Db Server version. + /// Monthly Storage Server version. + /// The database server model type of the cloud Exadata infrastructure resource. + /// The storage server model type of the cloud Exadata infrastructure resource. + /// The compute model of the Exadata Infrastructure. + /// A new instance for mocking. + public static CloudExadataInfrastructureProperties CloudExadataInfrastructureProperties(IEnumerable definedFileSystemConfiguration = null, string ocid = null, int? computeCount = null, int? storageCount = null, int? totalStorageSizeInGbs = null, int? availableStorageSizeInGbs = null, string timeCreated = null, string lifecycleDetails = null, MaintenanceWindow maintenanceWindow = null, EstimatedPatchingTime estimatedPatchingTime = null, IEnumerable customerContacts = null, AzureResourceProvisioningState? provisioningState = null, CloudExadataInfrastructureLifecycleState? lifecycleState = null, string shape = null, Uri ociUri = null, int? cpuCount = null, int? maxCpuCount = null, int? memorySizeInGbs = null, int? maxMemoryInGbs = null, int? dbNodeStorageSizeInGbs = null, int? maxDbNodeStorageSizeInGbs = null, double? dataStorageSizeInTbs = null, double? maxDataStorageInTbs = null, string dbServerVersion = null, string storageServerVersion = null, int? activatedStorageCount = null, int? additionalStorageCount = null, string displayName = null, string lastMaintenanceRunId = null, string nextMaintenanceRunId = null, string monthlyDbServerVersion = null, string monthlyStorageServerVersion = null, string databaseServerType = null, string storageServerType = null, ComputeModel? computeModel = null) + { + definedFileSystemConfiguration ??= new List(); + customerContacts ??= new List(); + + return new CloudExadataInfrastructureProperties( + definedFileSystemConfiguration?.ToList(), + ocid, + computeCount, + storageCount, + totalStorageSizeInGbs, + availableStorageSizeInGbs, + timeCreated, + lifecycleDetails, + maintenanceWindow, + estimatedPatchingTime, + customerContacts?.ToList(), + provisioningState, + lifecycleState, + shape, + ociUri, + cpuCount, + maxCpuCount, + memorySizeInGbs, + maxMemoryInGbs, + dbNodeStorageSizeInGbs, + maxDbNodeStorageSizeInGbs, + dataStorageSizeInTbs, + maxDataStorageInTbs, + dbServerVersion, + storageServerVersion, + activatedStorageCount, + additionalStorageCount, + displayName, + lastMaintenanceRunId, + nextMaintenanceRunId, + monthlyDbServerVersion, + monthlyStorageServerVersion, + databaseServerType, + storageServerType, + computeModel, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Checks if the data can be backed up. + /// Checks if the mount path is resizable. + /// Minimum size of mount path in Gb. + /// Mount path for the file system. + /// A new instance for mocking. + public static DefinedFileSystemConfiguration DefinedFileSystemConfiguration(bool? isBackupPartition = null, bool? isResizable = null, int? minSizeGb = null, string mountPoint = null) + { + return new DefinedFileSystemConfiguration(isBackupPartition, isResizable, minSizeGb, mountPoint, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The estimated time required in minutes for database server patching. + /// The estimated time required in minutes for network switch patching. + /// The estimated time required in minutes for storage server patching. + /// The estimated total time required in minutes for all patching operations. + /// A new instance for mocking. + public static EstimatedPatchingTime EstimatedPatchingTime(int? estimatedDbServerPatchingTime = null, int? estimatedNetworkSwitchesPatchingTime = null, int? estimatedStorageServerPatchingTime = null, int? totalEstimatedPatchingTime = null) + { + return new EstimatedPatchingTime(estimatedDbServerPatchingTime, estimatedNetworkSwitchesPatchingTime, estimatedStorageServerPatchingTime, totalEstimatedPatchingTime, 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 DbServerData DbServerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DbServerProperties properties = null) + { + return new DbServerData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Db server name. + /// The name for the Db Server. + /// The OCID of the compartment. + /// The OCID of the Exadata infrastructure. + /// The number of CPU cores enabled on the Db server. + /// dbServerPatching details of the Db server. + /// The total memory available in GBs. + /// The allocated local node storage in GBs on the Db server. + /// The OCID of the VM Clusters associated with the Db server. + /// The OCID of the Db nodes associated with the Db server. + /// Lifecycle details of dbServer. + /// DbServer provisioning state. + /// The total number of CPU cores available. + /// The list of OCIDs of the Autonomous VM Clusters associated with the Db server. + /// The list of OCIDs of the Autonomous Virtual Machines associated with the Db server. + /// The total max dbNode storage in GBs. + /// The total memory size in GBs. + /// The shape of the Db server. The shape determines the amount of CPU, storage, and memory resources available. + /// The date and time that the Db Server was created. + /// Azure resource provisioning state. + /// The compute model of the Exadata Infrastructure. + /// A new instance for mocking. + public static DbServerProperties DbServerProperties(string ocid = null, string displayName = null, string compartmentId = null, string exadataInfrastructureId = null, int? cpuCoreCount = null, DbServerPatchingDetails dbServerPatchingDetails = null, int? maxMemoryInGbs = null, int? dbNodeStorageSizeInGbs = null, IEnumerable vmClusterIds = null, IEnumerable dbNodeIds = null, string lifecycleDetails = null, DbServerProvisioningState? lifecycleState = null, int? maxCpuCount = null, IEnumerable autonomousVmClusterIds = null, IEnumerable autonomousVirtualMachineIds = null, int? maxDbNodeStorageInGbs = null, int? memorySizeInGbs = null, string shape = null, DateTimeOffset? timeCreated = null, ResourceProvisioningState? provisioningState = null, ComputeModel? computeModel = null) + { + vmClusterIds ??= new List(); + dbNodeIds ??= new List(); + autonomousVmClusterIds ??= new List(); + autonomousVirtualMachineIds ??= new List(); + + return new DbServerProperties( + ocid, + displayName, + compartmentId, + exadataInfrastructureId, + cpuCoreCount, + dbServerPatchingDetails, + maxMemoryInGbs, + dbNodeStorageSizeInGbs, + vmClusterIds?.ToList(), + dbNodeIds?.ToList(), + lifecycleDetails, + lifecycleState, + maxCpuCount, + autonomousVmClusterIds?.ToList(), + autonomousVirtualMachineIds?.ToList(), + maxDbNodeStorageInGbs, + memorySizeInGbs, + shape, + timeCreated, + provisioningState, + computeModel, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Estimated Patch Duration. + /// Patching Status. + /// Time Patching Ended. + /// Time Patching Started. + /// A new instance for mocking. + public static DbServerPatchingDetails DbServerPatchingDetails(int? estimatedPatchDuration = null, DbServerPatchingStatus? patchingStatus = null, DateTimeOffset? timePatchingEnded = null, DateTimeOffset? timePatchingStarted = null) + { + return new DbServerPatchingDetails(estimatedPatchDuration, patchingStatus, timePatchingEnded, timePatchingStarted, 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. + /// A new instance for mocking. + public static CloudVmClusterData CloudVmClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CloudVmClusterProperties properties = null) + { + tags ??= new Dictionary(); + + return new CloudVmClusterData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Cloud VM Cluster ocid. + /// The port number configured for the listener on the cloud VM cluster. + /// The number of nodes in the cloud VM cluster. + /// The data disk group size to be allocated in GBs per VM. + /// Array of mount path and size. + /// The data disk group size to be allocated in TBs. + /// The local node storage to be allocated in GBs. + /// The memory to be allocated in GBs. + /// The date and time that the cloud VM cluster was created. + /// Additional information about the current lifecycle state. + /// The time zone of the cloud VM cluster. For details, see [Exadata Infrastructure Time Zones](/Content/Database/References/timezones.htm). + /// The OCID of the zone the cloud VM cluster is associated with. + /// The hostname for the cloud VM cluster. + /// The domain name for the cloud VM cluster. + /// The number of CPU cores enabled on the cloud VM cluster. + /// The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal place is allowed for the fractional part. + /// The cluster name for cloud VM cluster. The cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + /// The percentage assigned to DATA storage (user data and database files). The remaining percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager backups). Accepted values are 35, 40, 60 and 80. The default is 80 percent assigned to DATA storage. See [Storage Configuration](/Content/Database/Concepts/exaoverview.htm#Exadata) in the Exadata documentation for details on the impact of the configuration settings on storage. + /// If true, database backup on local Exadata storage is configured for the cloud VM cluster. If false, database backup on local Exadata storage is not available in the cloud VM cluster. + /// Cloud Exadata Infrastructure ID. + /// If true, sparse disk group is configured for the cloud VM cluster. If false, sparse disk group is not created. + /// Operating system version of the image. + /// The public key portion of one or more key pairs used for SSH access to the cloud VM cluster. + /// The Oracle license model that applies to the cloud VM cluster. The default is LICENSE_INCLUDED. + /// The type of redundancy configured for the cloud Vm cluster. NORMAL is 2-way redundancy. HIGH is 3-way redundancy. + /// The Single Client Access Name (SCAN) IP addresses associated with the cloud VM cluster. SCAN IP addresses are typically used for load balancing and are not assigned to any interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. **Note:** For a single-node DB system, this list is empty. + /// The virtual IP (VIP) addresses associated with the cloud VM cluster. The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata Cloud Service instance to enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. **Note:** For a single-node DB system, this list is empty. + /// The FQDN of the DNS record for the SCAN IP addresses that are associated with the cloud VM cluster. + /// The TCP Single Client Access Name (SCAN) port. The default port is 1521. + /// The TCPS Single Client Access Name (SCAN) port. The default port is 2484. + /// The OCID of the DNS record for the SCAN IP addresses that are associated with the cloud VM cluster. + /// The model name of the Exadata hardware running the cloud VM cluster. + /// CloudVmCluster provisioning state. + /// CloudVmCluster lifecycle state. + /// VNET for network connectivity. + /// Oracle Grid Infrastructure (GI) software version. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface. + /// Client subnet. + /// Client OCI backup subnet CIDR, default is 192.168.252.0/22. + /// CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster will be added by default. + /// Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + /// Display Name. + /// The list of compute servers to be added to the cloud VM cluster. + /// iormConfigCache details for cloud VM cluster. + /// The OCID of the last maintenance update history entry. + /// The list of DB servers. + /// Cluster compartmentId. + /// Cluster subnet ocid. + /// The compute model of the VM Cluster. + /// A new instance for mocking. + public static CloudVmClusterProperties CloudVmClusterProperties(string ocid = null, long? listenerPort = null, int? nodeCount = null, int? storageSizeInGbs = null, IEnumerable fileSystemConfigurationDetails = null, double? dataStorageSizeInTbs = null, int? dbNodeStorageSizeInGbs = null, int? memorySizeInGbs = null, DateTimeOffset? timeCreated = null, string lifecycleDetails = null, string timeZone = null, string zoneId = null, string hostname = null, string domain = null, int cpuCoreCount = default, float? ocpuCount = null, string clusterName = null, int? dataStoragePercentage = null, bool? isLocalBackupEnabled = null, ResourceIdentifier cloudExadataInfrastructureId = null, bool? isSparseDiskgroupEnabled = null, string systemVersion = null, IEnumerable sshPublicKeys = null, LicenseModel? licenseModel = null, DiskRedundancy? diskRedundancy = null, IEnumerable scanIPIds = null, IEnumerable vipIds = null, string scanDnsName = null, int? scanListenerPortTcp = null, int? scanListenerPortTcpSsl = null, string scanDnsRecordId = null, string shape = null, AzureResourceProvisioningState? provisioningState = null, CloudVmClusterLifecycleState? lifecycleState = null, ResourceIdentifier vnetId = null, string giVersion = null, Uri ociUri = null, Uri nsgUri = null, ResourceIdentifier subnetId = null, string backupSubnetCidr = null, IEnumerable nsgCidrs = null, DataCollectionOptions dataCollectionOptions = null, string displayName = null, IEnumerable computeNodes = null, ExadataIormConfig iormConfigCache = null, string lastUpdateHistoryEntryId = null, IEnumerable dbServers = null, string compartmentId = null, string subnetOcid = null, ComputeModel? computeModel = null) + { + fileSystemConfigurationDetails ??= new List(); + sshPublicKeys ??= new List(); + scanIPIds ??= new List(); + vipIds ??= new List(); + nsgCidrs ??= new List(); + computeNodes ??= new List(); + dbServers ??= new List(); + + return new CloudVmClusterProperties( + ocid, + listenerPort, + nodeCount, + storageSizeInGbs, + fileSystemConfigurationDetails?.ToList(), + dataStorageSizeInTbs, + dbNodeStorageSizeInGbs, + memorySizeInGbs, + timeCreated, + lifecycleDetails, + timeZone, + zoneId, + hostname, + domain, + cpuCoreCount, + ocpuCount, + clusterName, + dataStoragePercentage, + isLocalBackupEnabled, + cloudExadataInfrastructureId, + isSparseDiskgroupEnabled, + systemVersion, + sshPublicKeys?.ToList(), + licenseModel, + diskRedundancy, + scanIPIds?.ToList(), + vipIds?.ToList(), + scanDnsName, + scanListenerPortTcp, + scanListenerPortTcpSsl, + scanDnsRecordId, + shape, + provisioningState, + lifecycleState, + vnetId, + giVersion, + ociUri, + nsgUri, + subnetId, + backupSubnetCidr, + nsgCidrs?.ToList(), + dataCollectionOptions, + displayName, + computeNodes?.ToList(), + iormConfigCache, + lastUpdateHistoryEntryId, + dbServers?.ToList(), + compartmentId, + subnetOcid, + computeModel, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// An array of IORM settings for all the database in the Exadata DB system. + /// Additional information about the current lifecycleState. + /// The current state of IORM configuration for the Exadata DB system. + /// The current value for the IORM objective. The default is AUTO. + /// A new instance for mocking. + public static ExadataIormConfig ExadataIormConfig(IEnumerable dbPlans = null, string lifecycleDetails = null, IormLifecycleState? lifecycleState = null, Objective? objective = null) + { + dbPlans ??= new List(); + + return new ExadataIormConfig(dbPlans?.ToList(), lifecycleDetails, lifecycleState, objective, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The database name. For the default DbPlan, the dbName is default. + /// The flash cache limit for this database. This value is internally configured based on the share value assigned to the database. + /// The relative priority of this database. + /// A new instance for mocking. + public static DbIormConfig DbIormConfig(string dbName = null, string flashCacheLimit = null, int? share = null) + { + return new DbIormConfig(dbName, flashCacheLimit, share, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// PrivateIpAddresses displayName. + /// PrivateIpAddresses hostnameLabel. + /// PrivateIpAddresses Id. + /// PrivateIpAddresses ipAddress. + /// PrivateIpAddresses subnetId. + /// A new instance for mocking. + public static PrivateIPAddressProperties PrivateIPAddressProperties(string displayName = null, string hostnameLabel = null, string ocid = null, string ipAddress = null, string subnetId = null) + { + return new PrivateIPAddressProperties( + displayName, + hostnameLabel, + ocid, + ipAddress, + subnetId, + 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 VirtualNetworkAddressData VirtualNetworkAddressData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, VirtualNetworkAddressProperties properties = null) + { + return new VirtualNetworkAddressData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Virtual network Address address. + /// Virtual Machine OCID. + /// Application VIP OCID. + /// Virtual network address fully qualified domain name. + /// Additional information about the current lifecycle state of the application virtual IP (VIP) address. + /// Azure resource provisioning state. + /// virtual network address lifecycle state. + /// The date and time when the create operation for the application virtual IP (VIP) address completed. + /// A new instance for mocking. + public static VirtualNetworkAddressProperties VirtualNetworkAddressProperties(string ipAddress = null, string vmOcid = null, string ocid = null, string domain = null, string lifecycleDetails = null, AzureResourceProvisioningState? provisioningState = null, VirtualNetworkAddressLifecycleState? lifecycleState = null, DateTimeOffset? timeAssigned = null) + { + return new VirtualNetworkAddressProperties( + ipAddress, + vmOcid, + ocid, + domain, + lifecycleDetails, + provisioningState, + lifecycleState, + timeAssigned, + 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 SystemVersionData SystemVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string systemVersion = null) + { + return new SystemVersionData( + id, + name, + resourceType, + systemData, + systemVersion != null ? new SystemVersionProperties(systemVersion, 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. + /// Details of the resource plan. + /// A new instance for mocking. + public static OracleSubscriptionData OracleSubscriptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, OracleSubscriptionProperties properties = null, ArmPlan plan = null) + { + return new OracleSubscriptionData( + id, + name, + resourceType, + systemData, + properties, + plan, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// OracleSubscriptionProvisioningState provisioning state. + /// SAAS subscription ID generated by Marketplace. + /// Cloud Account Id. + /// Cloud Account provisioning state. + /// Term Unit. P1Y, P3Y, etc, see Durations https://en.wikipedia.org/wiki/ISO_8601. + /// Product code for the term unit. + /// Intent for the update operation. + /// Azure subscriptions to be added. + /// State of the add Azure subscription operation on Oracle subscription. + /// Status details of the last operation on Oracle subscription. + /// A new instance for mocking. + public static OracleSubscriptionProperties OracleSubscriptionProperties(OracleSubscriptionProvisioningState? provisioningState = null, string saasSubscriptionId = null, string cloudAccountId = null, CloudAccountProvisioningState? cloudAccountState = null, string termUnit = null, string productCode = null, Intent? intent = null, IEnumerable azureSubscriptionIds = null, AddSubscriptionOperationState? addSubscriptionOperationState = null, string lastOperationStatusDetail = null) + { + azureSubscriptionIds ??= new List(); + + return new OracleSubscriptionProperties( + provisioningState, + saasSubscriptionId, + cloudAccountId, + cloudAccountState, + termUnit, + productCode, + intent, + azureSubscriptionIds?.ToList(), + addSubscriptionOperationState, + lastOperationStatusDetail, + 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 DbNodeData DbNodeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DbNodeProperties properties = null) + { + return new DbNodeData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// DbNode OCID. + /// Additional information about the planned maintenance. + /// The OCID of the backup IP address associated with the database node. + /// The OCID of the second backup VNIC. + /// The OCID of the backup VNIC. + /// The number of CPU cores enabled on the Db node. + /// The allocated local node storage in GBs on the Db node. + /// The OCID of the Exacc Db server associated with the database node. + /// The OCID of the DB system. + /// The name of the Fault Domain the instance is contained in. + /// The OCID of the host IP address associated with the database node. + /// The host name for the database node. + /// The current state of the database node. + /// Lifecycle details of Db Node. + /// The type of database node maintenance. + /// The allocated memory in GBs on the Db node. + /// The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine DB systems. + /// The date and time that the database node was created. + /// End date and time of maintenance window. + /// Start date and time of maintenance window. + /// The OCID of the second VNIC. + /// The OCID of the VNIC. + /// Azure resource provisioning state. + /// A new instance for mocking. + public static DbNodeProperties DbNodeProperties(string ocid = null, string additionalDetails = null, string backupIPId = null, string backupVnic2Id = null, string backupVnicId = null, int? cpuCoreCount = null, int? dbNodeStorageSizeInGbs = null, string dbServerId = null, string dbSystemId = null, string faultDomain = null, string hostIPId = null, string hostname = null, DbNodeProvisioningState lifecycleState = default, string lifecycleDetails = null, DbNodeMaintenanceType? maintenanceType = null, int? memorySizeInGbs = null, int? softwareStorageSizeInGb = null, DateTimeOffset timeCreated = default, DateTimeOffset? timeMaintenanceWindowEnd = null, DateTimeOffset? timeMaintenanceWindowStart = null, string vnic2Id = null, string vnicId = null, ResourceProvisioningState? provisioningState = null) + { + return new DbNodeProperties( + ocid, + additionalDetails, + backupIPId, + backupVnic2Id, + backupVnicId, + cpuCoreCount, + dbNodeStorageSizeInGbs, + dbServerId, + dbSystemId, + faultDomain, + hostIPId, + hostname, + lifecycleState, + lifecycleDetails, + maintenanceType, + memorySizeInGbs, + softwareStorageSizeInGb, + timeCreated, + timeMaintenanceWindowEnd, + timeMaintenanceWindowStart, + vnic2Id, + vnicId, + 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 GiVersionData GiVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string giVersion = null) + { + return new GiVersionData( + id, + name, + resourceType, + systemData, + giVersion != null ? new GiVersionProperties(giVersion, 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 GiMinorVersionData GiMinorVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, GiMinorVersionProperties properties = null) + { + return new GiMinorVersionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A valid Oracle Grid Infrastructure (GI) software version. + /// Grid Infrastructure Image Id. + /// A new instance for mocking. + public static GiMinorVersionProperties GiMinorVersionProperties(string version = null, string gridImageOcid = null) + { + return new GiMinorVersionProperties(version, gridImageOcid, 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 DbSystemShapeData DbSystemShapeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DbSystemShapeProperties properties = null) + { + return new DbSystemShapeData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The family of the shape used for the DB system. + /// The shape used for the DB system. + /// The maximum number of CPU cores that can be enabled on the DB system for this shape. + /// The minimum number of CPU cores that can be enabled on the DB system for this shape. + /// The runtime minimum number of CPU cores that can be enabled on the DB system for this shape. + /// The discrete number by which the CPU core count for this shape can be increased or decreased. + /// The minimum number of Exadata storage servers available for the Exadata infrastructure. + /// The maximum number of Exadata storage servers available for the Exadata infrastructure. + /// The maximum data storage available per storage server for this shape. Only applicable to ExaCC Elastic shapes. + /// The maximum memory available per database node for this shape. Only applicable to ExaCC Elastic shapes. + /// The maximum Db Node storage available per database node for this shape. Only applicable to ExaCC Elastic shapes. + /// The minimum number of CPU cores that can be enabled per node for this shape. + /// The maximum memory that can be enabled for this shape. + /// The minimum memory that need be allocated per node for this shape. + /// The maximum Db Node storage that can be enabled for this shape. + /// The minimum Db Node storage that need be allocated per node for this shape. + /// The maximum DATA storage that can be enabled for this shape. + /// The minimum data storage that need be allocated for this shape. + /// The minimum number of database nodes available for this shape. + /// The maximum number of database nodes available for this shape. + /// The maximum number of CPU cores per database node that can be enabled for this shape. Only applicable to the flex Exadata shape and ExaCC Elastic shapes. + /// The compute model of the Exadata Infrastructure. + /// Indicates if the shape supports database and storage server types. + /// The display name of the shape used for the DB system. + /// A new instance for mocking. + public static DbSystemShapeProperties DbSystemShapeProperties(string shapeFamily = null, string shapeName = null, int availableCoreCount = default, int? minimumCoreCount = null, int? runtimeMinimumCoreCount = null, int? coreCountIncrement = null, int? minStorageCount = null, int? maxStorageCount = null, double? availableDataStoragePerServerInTbs = null, int? availableMemoryPerNodeInGbs = null, int? availableDbNodePerNodeInGbs = null, int? minCoreCountPerNode = null, int? availableMemoryInGbs = null, int? minMemoryPerNodeInGbs = null, int? availableDbNodeStorageInGbs = null, int? minDbNodeStoragePerNodeInGbs = null, int? availableDataStorageInTbs = null, int? minDataStorageInTbs = null, int? minimumNodeCount = null, int? maximumNodeCount = null, int? availableCoreCountPerNode = null, ComputeModel? computeModel = null, bool? areServerTypesSupported = null, string displayName = null) + { + return new DbSystemShapeProperties( + shapeFamily, + shapeName, + availableCoreCount, + minimumCoreCount, + runtimeMinimumCoreCount, + coreCountIncrement, + minStorageCount, + maxStorageCount, + availableDataStoragePerServerInTbs, + availableMemoryPerNodeInGbs, + availableDbNodePerNodeInGbs, + minCoreCountPerNode, + availableMemoryInGbs, + minMemoryPerNodeInGbs, + availableDbNodeStorageInGbs, + minDbNodeStoragePerNodeInGbs, + availableDataStorageInTbs, + minDataStorageInTbs, + minimumNodeCount, + maximumNodeCount, + availableCoreCountPerNode, + computeModel, + areServerTypesSupported, + displayName, + 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 DnsPrivateViewData DnsPrivateViewData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DnsPrivateViewProperties properties = null) + { + return new DnsPrivateViewData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The OCID of the view. + /// The display name of the view resource. + /// A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. + /// Views lifecycleState. + /// The canonical absolute URL of the resource. + /// views timeCreated. + /// views timeCreated. + /// Azure resource provisioning state. + /// A new instance for mocking. + public static DnsPrivateViewProperties DnsPrivateViewProperties(string ocid = null, string displayName = null, bool isProtected = default, DnsPrivateViewsLifecycleState lifecycleState = default, string self = null, DateTimeOffset timeCreated = default, DateTimeOffset timeUpdated = default, ResourceProvisioningState? provisioningState = null) + { + return new DnsPrivateViewProperties( + ocid, + displayName, + isProtected, + lifecycleState, + self, + timeCreated, + timeUpdated, + 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 DnsPrivateZoneData DnsPrivateZoneData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DnsPrivateZoneProperties properties = null) + { + return new DnsPrivateZoneData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The OCID of the Zone. + /// A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. + /// Zones lifecycleState. + /// The canonical absolute URL of the resource. + /// The current serial of the zone. As seen in the zone's SOA record. + /// Version is the never-repeating, totally-orderable, version of the zone, from which the serial field of the zone's SOA record is derived. + /// The OCID of the private view containing the zone. This value will be null for zones in the global DNS, which are publicly resolvable and not part of a private view. + /// The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only supported for GLOBAL zones. + /// Zones timeCreated. + /// Azure resource provisioning state. + /// A new instance for mocking. + public static DnsPrivateZoneProperties DnsPrivateZoneProperties(string ocid = null, bool isProtected = default, DnsPrivateZonesLifecycleState lifecycleState = default, string self = null, int serial = default, string version = null, string viewId = null, ZoneType zoneType = default, DateTimeOffset timeCreated = default, ResourceProvisioningState? provisioningState = null) + { + return new DnsPrivateZoneProperties( + ocid, + isProtected, + lifecycleState, + self, + serial, + version, + viewId, + zoneType, + timeCreated, + 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 FlexComponentData FlexComponentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, FlexComponentProperties properties = null) + { + return new FlexComponentData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The minimum number of CPU cores that can be enabled on the DB Server for this Flex Component. + /// The maximum number of CPU cores that can be enabled on the DB Server for this Flex Component. + /// The maximum storage that can be enabled on the Storage Server for this Flex Component. + /// The runtime minimum number of CPU cores that can be enabled for this Flex Component. + /// The name of the DB system shape for this Flex Component. + /// The maximum memory size that can be enabled on the DB Server for this Flex Component. + /// The maximum local storage that can be enabled on the DB Server for this Flex Component. + /// The compute model of the DB Server for this Flex Component. + /// The hardware type of the DB (Compute) or Storage (Cell) Server for this Flex Component. + /// The description summary for this Flex Component. + /// A new instance for mocking. + public static FlexComponentProperties FlexComponentProperties(int? minimumCoreCount = null, int? availableCoreCount = null, int? availableDbStorageInGbs = null, int? runtimeMinimumCoreCount = null, string shape = null, int? availableMemoryInGbs = null, int? availableLocalStorageInGbs = null, string computeModel = null, HardwareType? hardwareType = null, string descriptionSummary = null) + { + return new FlexComponentProperties( + minimumCoreCount, + availableCoreCount, + availableDbStorageInGbs, + runtimeMinimumCoreCount, + shape, + availableMemoryInGbs, + availableLocalStorageInGbs, + computeModel, + hardwareType, + descriptionSummary, + 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. + /// 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 AutonomousDatabaseData AutonomousDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, AutonomousDatabaseBaseProperties properties = null) + { + tags ??= new Dictionary(); + + return new AutonomousDatabaseData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Admin password. + /// Database type to be created. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// A new instance for mocking. + public static AutonomousDatabaseBaseProperties AutonomousDatabaseBaseProperties(string adminPassword = null, string dataBaseType = null, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = null, string characterSet = null, float? computeCount = null, ComputeModel? computeModel = null, int? cpuCoreCount = null, IEnumerable customerContacts = null, int? dataStorageSizeInTbs = null, int? dataStorageSizeInGbs = null, string dbVersion = null, WorkloadType? dbWorkload = null, string displayName = null, bool? isAutoScalingEnabled = null, bool? isAutoScalingForStorageEnabled = null, IEnumerable peerDbIds = null, string peerDbId = null, bool? isLocalDataGuardEnabled = null, bool? isRemoteDataGuardEnabled = null, DisasterRecoveryType? localDisasterRecoveryType = null, DateTimeOffset? timeDisasterRecoveryRoleChanged = null, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = null, AutonomousDatabaseStandbySummary localStandbyDb = null, int? failedDataRecoveryInSeconds = null, bool? isMtlsConnectionRequired = null, bool? isPreviewVersionWithServiceTermsAccepted = null, LicenseModel? licenseModel = null, string ncharacterSet = null, string lifecycleDetails = null, AzureResourceProvisioningState? provisioningState = null, AutonomousDatabaseLifecycleState? lifecycleState = null, ScheduledOperationsType scheduledOperations = null, string privateEndpointIP = null, string privateEndpointLabel = null, string ociUri = null, ResourceIdentifier subnetId = null, ResourceIdentifier vnetId = null, DateTimeOffset? timeCreated = null, DateTimeOffset? timeMaintenanceBegin = null, DateTimeOffset? timeMaintenanceEnd = null, double? actualUsedDataStorageSizeInTbs = null, double? allocatedStorageSizeInTbs = null, ApexDetailsType apexDetails = null, IEnumerable availableUpgradeVersions = null, ConnectionStringType connectionStrings = null, ConnectionUrlType connectionUrls = null, DataSafeStatusType? dataSafeStatus = null, DatabaseEditionType? databaseEdition = null, ResourceIdentifier autonomousDatabaseId = null, int? inMemoryAreaInGbs = null, DateTimeOffset? nextLongTermBackupTimeStamp = null, LongTermBackUpScheduleDetails longTermBackupSchedule = null, bool? isPreview = null, int? localAdgAutoFailoverMaxDataLossLimit = null, int? memoryPerOracleComputeUnitInGbs = null, OpenModeType? openMode = null, OperationsInsightsStatusType? operationsInsightsStatus = null, PermissionLevelType? permissionLevel = null, string privateEndpoint = null, IEnumerable provisionableCpus = null, RoleType? role = null, string serviceConsoleUri = null, string sqlWebDeveloperUri = null, IEnumerable supportedRegionsToCloneTo = null, string timeDataGuardRoleChanged = null, string timeDeletionOfFreeAutonomousDatabase = null, string timeLocalDataGuardEnabled = null, string timeOfLastFailover = null, string timeOfLastRefresh = null, string timeOfLastRefreshPoint = null, string timeOfLastSwitchover = null, string timeReclamationOfFreeAutonomousDatabase = null, int? usedDataStorageSizeInGbs = null, int? usedDataStorageSizeInTbs = null, string ocid = null, int? backupRetentionPeriodInDays = null, IEnumerable whitelistedIPs = null) + { + customerContacts ??= new List(); + peerDbIds ??= new List(); + availableUpgradeVersions ??= new List(); + provisionableCpus ??= new List(); + supportedRegionsToCloneTo ??= new List(); + whitelistedIPs ??= new List(); + + return new UnknownAutonomousDatabaseBaseProperties( + adminPassword, + dataBaseType == null ? default : new DataBaseType(dataBaseType), + autonomousMaintenanceScheduleType, + characterSet, + computeCount, + computeModel, + cpuCoreCount, + customerContacts?.ToList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + dbVersion, + dbWorkload, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDbIds?.ToList(), + peerDbId, + isLocalDataGuardEnabled, + isRemoteDataGuardEnabled, + localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, + localStandbyDb, + failedDataRecoveryInSeconds, + isMtlsConnectionRequired, + isPreviewVersionWithServiceTermsAccepted, + licenseModel, + ncharacterSet, + lifecycleDetails, + provisioningState, + lifecycleState, + scheduledOperations, + privateEndpointIP, + privateEndpointLabel, + ociUri, + subnetId, + vnetId, + timeCreated, + timeMaintenanceBegin, + timeMaintenanceEnd, + actualUsedDataStorageSizeInTbs, + allocatedStorageSizeInTbs, + apexDetails, + availableUpgradeVersions?.ToList(), + connectionStrings, + connectionUrls, + dataSafeStatus, + databaseEdition, + autonomousDatabaseId, + inMemoryAreaInGbs, + nextLongTermBackupTimeStamp, + longTermBackupSchedule, + isPreview, + localAdgAutoFailoverMaxDataLossLimit, + memoryPerOracleComputeUnitInGbs, + openMode, + operationsInsightsStatus, + permissionLevel, + privateEndpoint, + provisionableCpus?.ToList(), + role, + serviceConsoleUri, + sqlWebDeveloperUri, + supportedRegionsToCloneTo?.ToList(), + timeDataGuardRoleChanged, + timeDeletionOfFreeAutonomousDatabase, + timeLocalDataGuardEnabled, + timeOfLastFailover, + timeOfLastRefresh, + timeOfLastRefreshPoint, + timeOfLastSwitchover, + timeReclamationOfFreeAutonomousDatabase, + usedDataStorageSizeInGbs, + usedDataStorageSizeInTbs, + ocid, + backupRetentionPeriodInDays, + whitelistedIPs?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The amount of time, in seconds, that the data of the standby database lags the data of the primary database. Can be used to determine the potential data loss in the event of a failover. + /// The current state of the Autonomous Database. + /// Additional information about the current lifecycle state. + /// The date and time the Autonomous Data Guard role was switched for the standby Autonomous Database. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// A new instance for mocking. + public static AutonomousDatabaseStandbySummary AutonomousDatabaseStandbySummary(int? lagTimeInSeconds = null, AutonomousDatabaseLifecycleState? lifecycleState = null, string lifecycleDetails = null, string timeDataGuardRoleChanged = null, string timeDisasterRecoveryRoleChanged = null) + { + return new AutonomousDatabaseStandbySummary( + lagTimeInSeconds, + lifecycleState, + lifecycleDetails, + timeDataGuardRoleChanged, + timeDisasterRecoveryRoleChanged, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Oracle APEX Application Development version. + /// The Oracle REST Data Services (ORDS) version. + /// A new instance for mocking. + public static ApexDetailsType ApexDetailsType(string apexVersion = null, string ordsVersion = null) + { + return new ApexDetailsType(apexVersion, ordsVersion, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Returns all connection strings that can be used to connect to the Autonomous Database. + /// The database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. + /// The High database service provides the highest level of resources to each SQL statement resulting in the highest performance, but supports the fewest number of concurrent SQL statements. + /// The Low database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. + /// The Medium database service provides a lower level of resources to each SQL statement potentially resulting a lower level of performance, but supports more concurrent SQL statements. + /// A list of connection string profiles to allow clients to group, filter and select connection string values based on structured metadata. + /// A new instance for mocking. + public static ConnectionStringType ConnectionStringType(AllConnectionStringType allConnectionStrings = null, string dedicated = null, string high = null, string low = null, string medium = null, IEnumerable profiles = null) + { + profiles ??= new List(); + + return new ConnectionStringType( + allConnectionStrings, + dedicated, + high, + low, + medium, + profiles?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The High database service provides the highest level of resources to each SQL statement resulting in the highest performance, but supports the fewest number of concurrent SQL statements. + /// The Low database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. + /// The Medium database service provides a lower level of resources to each SQL statement potentially resulting a lower level of performance, but supports more concurrent SQL statements. + /// A new instance for mocking. + public static AllConnectionStringType AllConnectionStringType(string high = null, string low = null, string medium = null) + { + return new AllConnectionStringType(high, low, medium, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Consumer group used by the connection. + /// A user-friendly name for the connection. + /// Host format used in connection string. + /// True for a regional connection string, applicable to cross-region DG only. + /// Protocol used by the connection. + /// Specifies whether the listener performs a direct hand-off of the session, or redirects the session. + /// Specifies whether the connection string is using the long (LONG), Easy Connect (EZCONNECT), or Easy Connect Plus (EZCONNECTPLUS) format. + /// Specifies whether the TLS handshake is using one-way (SERVER) or mutual (MUTUAL) authentication. + /// Connection string value. + /// A new instance for mocking. + public static ProfileType ProfileType(ConsumerGroup? consumerGroup = null, string displayName = null, HostFormatType hostFormat = default, bool? isRegional = null, ProtocolType protocol = default, SessionModeType sessionMode = default, SyntaxFormatType syntaxFormat = default, TlsAuthenticationType? tlsAuthentication = null, string value = null) + { + return new ProfileType( + consumerGroup, + displayName, + hostFormat, + isRegional, + protocol, + sessionMode, + syntaxFormat, + tlsAuthentication, + value, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Oracle Application Express (APEX) URL. + /// The URL of the Database Transforms for the Autonomous Database. + /// The URL of the Graph Studio for the Autonomous Database. + /// The URL of the Oracle Machine Learning (OML) Notebook for the Autonomous Database. + /// The URL of the MongoDB API for the Autonomous Database. + /// The Oracle REST Data Services (ORDS) URL of the Web Access for the Autonomous Database. + /// Oracle SQL Developer Web URL. + /// A new instance for mocking. + public static ConnectionUrlType ConnectionUrlType(string apexUri = null, string databaseTransformsUri = null, string graphStudioUri = null, string machineLearningNotebookUri = null, string mongoDbUri = null, string ordsUri = null, string sqlDevWebUri = null) + { + return new ConnectionUrlType( + apexUri, + databaseTransformsUri, + graphStudioUri, + machineLearningNotebookUri, + mongoDbUri, + ordsUri, + sqlDevWebUri, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Admin password. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// A new instance for mocking. + public static AutonomousDatabaseProperties AutonomousDatabaseProperties(string adminPassword = null, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = null, string characterSet = null, float? computeCount = null, ComputeModel? computeModel = null, int? cpuCoreCount = null, IEnumerable customerContacts = null, int? dataStorageSizeInTbs = null, int? dataStorageSizeInGbs = null, string dbVersion = null, WorkloadType? dbWorkload = null, string displayName = null, bool? isAutoScalingEnabled = null, bool? isAutoScalingForStorageEnabled = null, IEnumerable peerDbIds = null, string peerDbId = null, bool? isLocalDataGuardEnabled = null, bool? isRemoteDataGuardEnabled = null, DisasterRecoveryType? localDisasterRecoveryType = null, DateTimeOffset? timeDisasterRecoveryRoleChanged = null, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = null, AutonomousDatabaseStandbySummary localStandbyDb = null, int? failedDataRecoveryInSeconds = null, bool? isMtlsConnectionRequired = null, bool? isPreviewVersionWithServiceTermsAccepted = null, LicenseModel? licenseModel = null, string ncharacterSet = null, string lifecycleDetails = null, AzureResourceProvisioningState? provisioningState = null, AutonomousDatabaseLifecycleState? lifecycleState = null, ScheduledOperationsType scheduledOperations = null, string privateEndpointIP = null, string privateEndpointLabel = null, string ociUri = null, ResourceIdentifier subnetId = null, ResourceIdentifier vnetId = null, DateTimeOffset? timeCreated = null, DateTimeOffset? timeMaintenanceBegin = null, DateTimeOffset? timeMaintenanceEnd = null, double? actualUsedDataStorageSizeInTbs = null, double? allocatedStorageSizeInTbs = null, ApexDetailsType apexDetails = null, IEnumerable availableUpgradeVersions = null, ConnectionStringType connectionStrings = null, ConnectionUrlType connectionUrls = null, DataSafeStatusType? dataSafeStatus = null, DatabaseEditionType? databaseEdition = null, ResourceIdentifier autonomousDatabaseId = null, int? inMemoryAreaInGbs = null, DateTimeOffset? nextLongTermBackupTimeStamp = null, LongTermBackUpScheduleDetails longTermBackupSchedule = null, bool? isPreview = null, int? localAdgAutoFailoverMaxDataLossLimit = null, int? memoryPerOracleComputeUnitInGbs = null, OpenModeType? openMode = null, OperationsInsightsStatusType? operationsInsightsStatus = null, PermissionLevelType? permissionLevel = null, string privateEndpoint = null, IEnumerable provisionableCpus = null, RoleType? role = null, string serviceConsoleUri = null, string sqlWebDeveloperUri = null, IEnumerable supportedRegionsToCloneTo = null, string timeDataGuardRoleChanged = null, string timeDeletionOfFreeAutonomousDatabase = null, string timeLocalDataGuardEnabled = null, string timeOfLastFailover = null, string timeOfLastRefresh = null, string timeOfLastRefreshPoint = null, string timeOfLastSwitchover = null, string timeReclamationOfFreeAutonomousDatabase = null, int? usedDataStorageSizeInGbs = null, int? usedDataStorageSizeInTbs = null, string ocid = null, int? backupRetentionPeriodInDays = null, IEnumerable whitelistedIPs = null) + { + customerContacts ??= new List(); + peerDbIds ??= new List(); + availableUpgradeVersions ??= new List(); + provisionableCpus ??= new List(); + supportedRegionsToCloneTo ??= new List(); + whitelistedIPs ??= new List(); + + return new AutonomousDatabaseProperties( + adminPassword, + DataBaseType.Regular, + autonomousMaintenanceScheduleType, + characterSet, + computeCount, + computeModel, + cpuCoreCount, + customerContacts?.ToList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + dbVersion, + dbWorkload, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDbIds?.ToList(), + peerDbId, + isLocalDataGuardEnabled, + isRemoteDataGuardEnabled, + localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, + localStandbyDb, + failedDataRecoveryInSeconds, + isMtlsConnectionRequired, + isPreviewVersionWithServiceTermsAccepted, + licenseModel, + ncharacterSet, + lifecycleDetails, + provisioningState, + lifecycleState, + scheduledOperations, + privateEndpointIP, + privateEndpointLabel, + ociUri, + subnetId, + vnetId, + timeCreated, + timeMaintenanceBegin, + timeMaintenanceEnd, + actualUsedDataStorageSizeInTbs, + allocatedStorageSizeInTbs, + apexDetails, + availableUpgradeVersions?.ToList(), + connectionStrings, + connectionUrls, + dataSafeStatus, + databaseEdition, + autonomousDatabaseId, + inMemoryAreaInGbs, + nextLongTermBackupTimeStamp, + longTermBackupSchedule, + isPreview, + localAdgAutoFailoverMaxDataLossLimit, + memoryPerOracleComputeUnitInGbs, + openMode, + operationsInsightsStatus, + permissionLevel, + privateEndpoint, + provisionableCpus?.ToList(), + role, + serviceConsoleUri, + sqlWebDeveloperUri, + supportedRegionsToCloneTo?.ToList(), + timeDataGuardRoleChanged, + timeDeletionOfFreeAutonomousDatabase, + timeLocalDataGuardEnabled, + timeOfLastFailover, + timeOfLastRefresh, + timeOfLastRefreshPoint, + timeOfLastSwitchover, + timeReclamationOfFreeAutonomousDatabase, + usedDataStorageSizeInGbs, + usedDataStorageSizeInTbs, + ocid, + backupRetentionPeriodInDays, + whitelistedIPs?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Admin password. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// The source of the database. + /// The Azure resource ID of the Autonomous Database that was cloned to create the current Autonomous Database. + /// The Autonomous Database clone type. + /// Indicates if the refreshable clone can be reconnected to its source database. + /// Indicates if the Autonomous Database is a refreshable clone. + /// The refresh mode of the clone. + /// The refresh status of the clone. + /// The time and date as an RFC3339 formatted string, e.g., 2022-01-01T12:00:00.000Z, to set the limit for a refreshable clone to be reconnected to its source database. + /// A new instance for mocking. + public static AutonomousDatabaseCloneProperties AutonomousDatabaseCloneProperties(string adminPassword = null, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = null, string characterSet = null, float? computeCount = null, ComputeModel? computeModel = null, int? cpuCoreCount = null, IEnumerable customerContacts = null, int? dataStorageSizeInTbs = null, int? dataStorageSizeInGbs = null, string dbVersion = null, WorkloadType? dbWorkload = null, string displayName = null, bool? isAutoScalingEnabled = null, bool? isAutoScalingForStorageEnabled = null, IEnumerable peerDbIds = null, string peerDbId = null, bool? isLocalDataGuardEnabled = null, bool? isRemoteDataGuardEnabled = null, DisasterRecoveryType? localDisasterRecoveryType = null, DateTimeOffset? timeDisasterRecoveryRoleChanged = null, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = null, AutonomousDatabaseStandbySummary localStandbyDb = null, int? failedDataRecoveryInSeconds = null, bool? isMtlsConnectionRequired = null, bool? isPreviewVersionWithServiceTermsAccepted = null, LicenseModel? licenseModel = null, string ncharacterSet = null, string lifecycleDetails = null, AzureResourceProvisioningState? provisioningState = null, AutonomousDatabaseLifecycleState? lifecycleState = null, ScheduledOperationsType scheduledOperations = null, string privateEndpointIP = null, string privateEndpointLabel = null, string ociUri = null, ResourceIdentifier subnetId = null, ResourceIdentifier vnetId = null, DateTimeOffset? timeCreated = null, DateTimeOffset? timeMaintenanceBegin = null, DateTimeOffset? timeMaintenanceEnd = null, double? actualUsedDataStorageSizeInTbs = null, double? allocatedStorageSizeInTbs = null, ApexDetailsType apexDetails = null, IEnumerable availableUpgradeVersions = null, ConnectionStringType connectionStrings = null, ConnectionUrlType connectionUrls = null, DataSafeStatusType? dataSafeStatus = null, DatabaseEditionType? databaseEdition = null, ResourceIdentifier autonomousDatabaseId = null, int? inMemoryAreaInGbs = null, DateTimeOffset? nextLongTermBackupTimeStamp = null, LongTermBackUpScheduleDetails longTermBackupSchedule = null, bool? isPreview = null, int? localAdgAutoFailoverMaxDataLossLimit = null, int? memoryPerOracleComputeUnitInGbs = null, OpenModeType? openMode = null, OperationsInsightsStatusType? operationsInsightsStatus = null, PermissionLevelType? permissionLevel = null, string privateEndpoint = null, IEnumerable provisionableCpus = null, RoleType? role = null, string serviceConsoleUri = null, string sqlWebDeveloperUri = null, IEnumerable supportedRegionsToCloneTo = null, string timeDataGuardRoleChanged = null, string timeDeletionOfFreeAutonomousDatabase = null, string timeLocalDataGuardEnabled = null, string timeOfLastFailover = null, string timeOfLastRefresh = null, string timeOfLastRefreshPoint = null, string timeOfLastSwitchover = null, string timeReclamationOfFreeAutonomousDatabase = null, int? usedDataStorageSizeInGbs = null, int? usedDataStorageSizeInTbs = null, string ocid = null, int? backupRetentionPeriodInDays = null, IEnumerable whitelistedIPs = null, SourceType? source = null, ResourceIdentifier sourceId = null, CloneType cloneType = default, bool? isReconnectCloneEnabled = null, bool? isRefreshableClone = null, RefreshableModelType? refreshableModel = null, RefreshableStatusType? refreshableStatus = null, string timeUntilReconnectCloneEnabled = null) + { + customerContacts ??= new List(); + peerDbIds ??= new List(); + availableUpgradeVersions ??= new List(); + provisionableCpus ??= new List(); + supportedRegionsToCloneTo ??= new List(); + whitelistedIPs ??= new List(); + + return new AutonomousDatabaseCloneProperties( + adminPassword, + DataBaseType.Clone, + autonomousMaintenanceScheduleType, + characterSet, + computeCount, + computeModel, + cpuCoreCount, + customerContacts?.ToList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + dbVersion, + dbWorkload, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDbIds?.ToList(), + peerDbId, + isLocalDataGuardEnabled, + isRemoteDataGuardEnabled, + localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, + localStandbyDb, + failedDataRecoveryInSeconds, + isMtlsConnectionRequired, + isPreviewVersionWithServiceTermsAccepted, + licenseModel, + ncharacterSet, + lifecycleDetails, + provisioningState, + lifecycleState, + scheduledOperations, + privateEndpointIP, + privateEndpointLabel, + ociUri, + subnetId, + vnetId, + timeCreated, + timeMaintenanceBegin, + timeMaintenanceEnd, + actualUsedDataStorageSizeInTbs, + allocatedStorageSizeInTbs, + apexDetails, + availableUpgradeVersions?.ToList(), + connectionStrings, + connectionUrls, + dataSafeStatus, + databaseEdition, + autonomousDatabaseId, + inMemoryAreaInGbs, + nextLongTermBackupTimeStamp, + longTermBackupSchedule, + isPreview, + localAdgAutoFailoverMaxDataLossLimit, + memoryPerOracleComputeUnitInGbs, + openMode, + operationsInsightsStatus, + permissionLevel, + privateEndpoint, + provisionableCpus?.ToList(), + role, + serviceConsoleUri, + sqlWebDeveloperUri, + supportedRegionsToCloneTo?.ToList(), + timeDataGuardRoleChanged, + timeDeletionOfFreeAutonomousDatabase, + timeLocalDataGuardEnabled, + timeOfLastFailover, + timeOfLastRefresh, + timeOfLastRefreshPoint, + timeOfLastSwitchover, + timeReclamationOfFreeAutonomousDatabase, + usedDataStorageSizeInGbs, + usedDataStorageSizeInTbs, + ocid, + backupRetentionPeriodInDays, + whitelistedIPs?.ToList(), + serializedAdditionalRawData: null, + source, + sourceId, + cloneType, + isReconnectCloneEnabled, + isRefreshableClone, + refreshableModel, + refreshableStatus, + timeUntilReconnectCloneEnabled); + } + + /// Initializes a new instance of . + /// Admin password. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// The source of the database. + /// The Azure ID of the source Autonomous Database that will be used to create a new peer database for the DR association. + /// The name of the region where source Autonomous Database exists. + /// The source database ocid. + /// Indicates the cross-region disaster recovery (DR) type of the standby Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the backups taken on the Primary are not replicated to the Standby database. + /// A new instance for mocking. + public static AutonomousDatabaseCrossRegionDisasterRecoveryProperties AutonomousDatabaseCrossRegionDisasterRecoveryProperties(string adminPassword = null, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = null, string characterSet = null, float? computeCount = null, ComputeModel? computeModel = null, int? cpuCoreCount = null, IEnumerable customerContacts = null, int? dataStorageSizeInTbs = null, int? dataStorageSizeInGbs = null, string dbVersion = null, WorkloadType? dbWorkload = null, string displayName = null, bool? isAutoScalingEnabled = null, bool? isAutoScalingForStorageEnabled = null, IEnumerable peerDbIds = null, string peerDbId = null, bool? isLocalDataGuardEnabled = null, bool? isRemoteDataGuardEnabled = null, DisasterRecoveryType? localDisasterRecoveryType = null, DateTimeOffset? timeDisasterRecoveryRoleChanged = null, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = null, AutonomousDatabaseStandbySummary localStandbyDb = null, int? failedDataRecoveryInSeconds = null, bool? isMtlsConnectionRequired = null, bool? isPreviewVersionWithServiceTermsAccepted = null, LicenseModel? licenseModel = null, string ncharacterSet = null, string lifecycleDetails = null, AzureResourceProvisioningState? provisioningState = null, AutonomousDatabaseLifecycleState? lifecycleState = null, ScheduledOperationsType scheduledOperations = null, string privateEndpointIP = null, string privateEndpointLabel = null, string ociUri = null, ResourceIdentifier subnetId = null, ResourceIdentifier vnetId = null, DateTimeOffset? timeCreated = null, DateTimeOffset? timeMaintenanceBegin = null, DateTimeOffset? timeMaintenanceEnd = null, double? actualUsedDataStorageSizeInTbs = null, double? allocatedStorageSizeInTbs = null, ApexDetailsType apexDetails = null, IEnumerable availableUpgradeVersions = null, ConnectionStringType connectionStrings = null, ConnectionUrlType connectionUrls = null, DataSafeStatusType? dataSafeStatus = null, DatabaseEditionType? databaseEdition = null, ResourceIdentifier autonomousDatabaseId = null, int? inMemoryAreaInGbs = null, DateTimeOffset? nextLongTermBackupTimeStamp = null, LongTermBackUpScheduleDetails longTermBackupSchedule = null, bool? isPreview = null, int? localAdgAutoFailoverMaxDataLossLimit = null, int? memoryPerOracleComputeUnitInGbs = null, OpenModeType? openMode = null, OperationsInsightsStatusType? operationsInsightsStatus = null, PermissionLevelType? permissionLevel = null, string privateEndpoint = null, IEnumerable provisionableCpus = null, RoleType? role = null, string serviceConsoleUri = null, string sqlWebDeveloperUri = null, IEnumerable supportedRegionsToCloneTo = null, string timeDataGuardRoleChanged = null, string timeDeletionOfFreeAutonomousDatabase = null, string timeLocalDataGuardEnabled = null, string timeOfLastFailover = null, string timeOfLastRefresh = null, string timeOfLastRefreshPoint = null, string timeOfLastSwitchover = null, string timeReclamationOfFreeAutonomousDatabase = null, int? usedDataStorageSizeInGbs = null, int? usedDataStorageSizeInTbs = null, string ocid = null, int? backupRetentionPeriodInDays = null, IEnumerable whitelistedIPs = null, SourceType source = default, ResourceIdentifier sourceId = null, string sourceLocation = null, string sourceOcid = null, DisasterRecoveryType remoteDisasterRecoveryType = default, bool? isReplicateAutomaticBackups = null) + { + customerContacts ??= new List(); + peerDbIds ??= new List(); + availableUpgradeVersions ??= new List(); + provisionableCpus ??= new List(); + supportedRegionsToCloneTo ??= new List(); + whitelistedIPs ??= new List(); + + return new AutonomousDatabaseCrossRegionDisasterRecoveryProperties( + adminPassword, + DataBaseType.CrossRegionDisasterRecovery, + autonomousMaintenanceScheduleType, + characterSet, + computeCount, + computeModel, + cpuCoreCount, + customerContacts?.ToList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + dbVersion, + dbWorkload, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDbIds?.ToList(), + peerDbId, + isLocalDataGuardEnabled, + isRemoteDataGuardEnabled, + localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, + localStandbyDb, + failedDataRecoveryInSeconds, + isMtlsConnectionRequired, + isPreviewVersionWithServiceTermsAccepted, + licenseModel, + ncharacterSet, + lifecycleDetails, + provisioningState, + lifecycleState, + scheduledOperations, + privateEndpointIP, + privateEndpointLabel, + ociUri, + subnetId, + vnetId, + timeCreated, + timeMaintenanceBegin, + timeMaintenanceEnd, + actualUsedDataStorageSizeInTbs, + allocatedStorageSizeInTbs, + apexDetails, + availableUpgradeVersions?.ToList(), + connectionStrings, + connectionUrls, + dataSafeStatus, + databaseEdition, + autonomousDatabaseId, + inMemoryAreaInGbs, + nextLongTermBackupTimeStamp, + longTermBackupSchedule, + isPreview, + localAdgAutoFailoverMaxDataLossLimit, + memoryPerOracleComputeUnitInGbs, + openMode, + operationsInsightsStatus, + permissionLevel, + privateEndpoint, + provisionableCpus?.ToList(), + role, + serviceConsoleUri, + sqlWebDeveloperUri, + supportedRegionsToCloneTo?.ToList(), + timeDataGuardRoleChanged, + timeDeletionOfFreeAutonomousDatabase, + timeLocalDataGuardEnabled, + timeOfLastFailover, + timeOfLastRefresh, + timeOfLastRefreshPoint, + timeOfLastSwitchover, + timeReclamationOfFreeAutonomousDatabase, + usedDataStorageSizeInGbs, + usedDataStorageSizeInTbs, + ocid, + backupRetentionPeriodInDays, + whitelistedIPs?.ToList(), + serializedAdditionalRawData: null, + source, + sourceId, + sourceLocation, + sourceOcid, + remoteDisasterRecoveryType, + isReplicateAutomaticBackups); + } + + /// Initializes a new instance of . + /// Admin password. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// The source of the database. + /// The ID of the source Autonomous Database that you will clone to create a new Autonomous Database. + /// The Autonomous Database clone type. + /// The timestamp specified for the point-in-time clone of the source Autonomous Database. The timestamp must be in the past. + /// Clone from latest available backup timestamp. + /// A new instance for mocking. + public static AutonomousDatabaseFromBackupTimestampProperties AutonomousDatabaseFromBackupTimestampProperties(string adminPassword = null, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = null, string characterSet = null, float? computeCount = null, ComputeModel? computeModel = null, int? cpuCoreCount = null, IEnumerable customerContacts = null, int? dataStorageSizeInTbs = null, int? dataStorageSizeInGbs = null, string dbVersion = null, WorkloadType? dbWorkload = null, string displayName = null, bool? isAutoScalingEnabled = null, bool? isAutoScalingForStorageEnabled = null, IEnumerable peerDbIds = null, string peerDbId = null, bool? isLocalDataGuardEnabled = null, bool? isRemoteDataGuardEnabled = null, DisasterRecoveryType? localDisasterRecoveryType = null, DateTimeOffset? timeDisasterRecoveryRoleChanged = null, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = null, AutonomousDatabaseStandbySummary localStandbyDb = null, int? failedDataRecoveryInSeconds = null, bool? isMtlsConnectionRequired = null, bool? isPreviewVersionWithServiceTermsAccepted = null, LicenseModel? licenseModel = null, string ncharacterSet = null, string lifecycleDetails = null, AzureResourceProvisioningState? provisioningState = null, AutonomousDatabaseLifecycleState? lifecycleState = null, ScheduledOperationsType scheduledOperations = null, string privateEndpointIP = null, string privateEndpointLabel = null, string ociUri = null, ResourceIdentifier subnetId = null, ResourceIdentifier vnetId = null, DateTimeOffset? timeCreated = null, DateTimeOffset? timeMaintenanceBegin = null, DateTimeOffset? timeMaintenanceEnd = null, double? actualUsedDataStorageSizeInTbs = null, double? allocatedStorageSizeInTbs = null, ApexDetailsType apexDetails = null, IEnumerable availableUpgradeVersions = null, ConnectionStringType connectionStrings = null, ConnectionUrlType connectionUrls = null, DataSafeStatusType? dataSafeStatus = null, DatabaseEditionType? databaseEdition = null, ResourceIdentifier autonomousDatabaseId = null, int? inMemoryAreaInGbs = null, DateTimeOffset? nextLongTermBackupTimeStamp = null, LongTermBackUpScheduleDetails longTermBackupSchedule = null, bool? isPreview = null, int? localAdgAutoFailoverMaxDataLossLimit = null, int? memoryPerOracleComputeUnitInGbs = null, OpenModeType? openMode = null, OperationsInsightsStatusType? operationsInsightsStatus = null, PermissionLevelType? permissionLevel = null, string privateEndpoint = null, IEnumerable provisionableCpus = null, RoleType? role = null, string serviceConsoleUri = null, string sqlWebDeveloperUri = null, IEnumerable supportedRegionsToCloneTo = null, string timeDataGuardRoleChanged = null, string timeDeletionOfFreeAutonomousDatabase = null, string timeLocalDataGuardEnabled = null, string timeOfLastFailover = null, string timeOfLastRefresh = null, string timeOfLastRefreshPoint = null, string timeOfLastSwitchover = null, string timeReclamationOfFreeAutonomousDatabase = null, int? usedDataStorageSizeInGbs = null, int? usedDataStorageSizeInTbs = null, string ocid = null, int? backupRetentionPeriodInDays = null, IEnumerable whitelistedIPs = null, SourceType source = default, ResourceIdentifier sourceId = null, CloneType cloneType = default, DateTimeOffset? timestamp = null, bool? useLatestAvailableBackupTimeStamp = null) + { + customerContacts ??= new List(); + peerDbIds ??= new List(); + availableUpgradeVersions ??= new List(); + provisionableCpus ??= new List(); + supportedRegionsToCloneTo ??= new List(); + whitelistedIPs ??= new List(); + + return new AutonomousDatabaseFromBackupTimestampProperties( + adminPassword, + DataBaseType.CloneFromBackupTimestamp, + autonomousMaintenanceScheduleType, + characterSet, + computeCount, + computeModel, + cpuCoreCount, + customerContacts?.ToList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + dbVersion, + dbWorkload, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDbIds?.ToList(), + peerDbId, + isLocalDataGuardEnabled, + isRemoteDataGuardEnabled, + localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, + localStandbyDb, + failedDataRecoveryInSeconds, + isMtlsConnectionRequired, + isPreviewVersionWithServiceTermsAccepted, + licenseModel, + ncharacterSet, + lifecycleDetails, + provisioningState, + lifecycleState, + scheduledOperations, + privateEndpointIP, + privateEndpointLabel, + ociUri, + subnetId, + vnetId, + timeCreated, + timeMaintenanceBegin, + timeMaintenanceEnd, + actualUsedDataStorageSizeInTbs, + allocatedStorageSizeInTbs, + apexDetails, + availableUpgradeVersions?.ToList(), + connectionStrings, + connectionUrls, + dataSafeStatus, + databaseEdition, + autonomousDatabaseId, + inMemoryAreaInGbs, + nextLongTermBackupTimeStamp, + longTermBackupSchedule, + isPreview, + localAdgAutoFailoverMaxDataLossLimit, + memoryPerOracleComputeUnitInGbs, + openMode, + operationsInsightsStatus, + permissionLevel, + privateEndpoint, + provisionableCpus?.ToList(), + role, + serviceConsoleUri, + sqlWebDeveloperUri, + supportedRegionsToCloneTo?.ToList(), + timeDataGuardRoleChanged, + timeDeletionOfFreeAutonomousDatabase, + timeLocalDataGuardEnabled, + timeOfLastFailover, + timeOfLastRefresh, + timeOfLastRefreshPoint, + timeOfLastSwitchover, + timeReclamationOfFreeAutonomousDatabase, + usedDataStorageSizeInGbs, + usedDataStorageSizeInTbs, + ocid, + backupRetentionPeriodInDays, + whitelistedIPs?.ToList(), + serializedAdditionalRawData: null, + source, + sourceId, + cloneType, + timestamp, + useLatestAvailableBackupTimeStamp); + } + + /// Initializes a new instance of . + /// The type of wallet to generate. + /// True when requesting regional connection strings in PDB connect info, applicable to cross-region DG only. + /// The password to encrypt the keys inside the wallet. + /// A new instance for mocking. + public static GenerateAutonomousDatabaseWalletDetails GenerateAutonomousDatabaseWalletDetails(GenerateType? generateType = null, bool? isRegional = null, string password = null) + { + return new GenerateAutonomousDatabaseWalletDetails(generateType, isRegional, password, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The base64 encoded wallet files. + /// A new instance for mocking. + public static AutonomousDatabaseWalletFile AutonomousDatabaseWalletFile(string walletFiles = null) + { + return new AutonomousDatabaseWalletFile(walletFiles, 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 AutonomousDatabaseBackupData AutonomousDatabaseBackupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AutonomousDatabaseBackupProperties properties = null) + { + return new AutonomousDatabaseBackupData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The OCID of the Autonomous Database. + /// The size of the database in terabytes at the time the backup was taken. + /// A valid Oracle Database version for Autonomous Database. + /// The user-friendly name for the backup. The name does not have to be unique. + /// The OCID of the Autonomous Database backup. + /// Indicates whether the backup is user-initiated or automatic. + /// Indicates whether the backup can be used to restore the associated Autonomous Database. + /// Additional information about the current lifecycle state. + /// The current state of the backup. + /// Retention period, in days. + /// The backup size in terabytes (TB). + /// Timestamp until when the backup will be available. + /// The date and time the backup started. + /// The date and time the backup completed. + /// The type of backup. + /// Azure resource provisioning state. + /// A new instance for mocking. + public static AutonomousDatabaseBackupProperties AutonomousDatabaseBackupProperties(string autonomousDatabaseOcid = null, double? databaseSizeInTbs = null, string dbVersion = null, string displayName = null, string ocid = null, bool? isAutomatic = null, bool? isRestorable = null, string lifecycleDetails = null, AutonomousDatabaseBackupLifecycleState? lifecycleState = null, int? retentionPeriodInDays = null, double? sizeInTbs = null, DateTimeOffset? timeAvailableTil = null, string timeStarted = null, string timeEnded = null, AutonomousDatabaseBackupType? backupType = null, AzureResourceProvisioningState? provisioningState = null) + { + return new AutonomousDatabaseBackupProperties( + autonomousDatabaseOcid, + databaseSizeInTbs, + dbVersion, + displayName, + ocid, + isAutomatic, + isRestorable, + lifecycleDetails, + lifecycleState, + retentionPeriodInDays, + sizeInTbs, + timeAvailableTil, + timeStarted, + timeEnded, + backupType, + 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 AutonomousDatabaseCharacterSetData AutonomousDatabaseCharacterSetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string autonomousDatabaseCharacterSet = null) + { + return new AutonomousDatabaseCharacterSetData( + id, + name, + resourceType, + systemData, + autonomousDatabaseCharacterSet != null ? new AutonomousDatabaseCharacterSetProperties(autonomousDatabaseCharacterSet, 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 AutonomousDatabaseNationalCharacterSetData AutonomousDatabaseNationalCharacterSetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string autonomousDatabaseNationalCharacterSet = null) + { + return new AutonomousDatabaseNationalCharacterSetData( + id, + name, + resourceType, + systemData, + autonomousDatabaseNationalCharacterSet != null ? new AutonomousDatabaseNationalCharacterSetProperties(autonomousDatabaseNationalCharacterSet, 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 AutonomousDbVersionData AutonomousDbVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AutonomousDbVersionProperties properties = null) + { + return new AutonomousDbVersionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Supported Autonomous Db versions. + /// The Autonomous Database workload type. + /// True if this version of the Oracle Database software's default is free. + /// True if this version of the Oracle Database software's default is paid. + /// True if this version of the Oracle Database software can be used for Always-Free Autonomous Databases. + /// True if this version of the Oracle Database software has payments enabled. + /// A new instance for mocking. + public static AutonomousDbVersionProperties AutonomousDbVersionProperties(string version = null, WorkloadType? dbWorkload = null, bool? isDefaultForFree = null, bool? isDefaultForPaid = null, bool? isFreeTierEnabled = null, bool? isPaidEnabled = null) + { + return new AutonomousDbVersionProperties( + version, + dbWorkload, + isDefaultForFree, + isDefaultForPaid, + isFreeTierEnabled, + isPaidEnabled, + 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 availability zones. + /// A new instance for mocking. + public static ExadbVmClusterData ExadbVmClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExadbVmClusterProperties properties = null, IEnumerable zones = null) + { + tags ??= new Dictionary(); + zones ??= new List(); + + return new ExadbVmClusterData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + zones?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// ExadbVmCluster ocid. + /// The cluster name for Exadata VM cluster on Exascale Infrastructure. The cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + /// Client OCI backup subnet CIDR, default is 192.168.252.0/22. + /// HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface. + /// Exadata VM cluster on Exascale Infrastructure provisioning state. + /// CloudVmCluster lifecycle state. + /// VNET for network connectivity. + /// Client subnet. + /// Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + /// Display Name. + /// A domain name used for the Exadata VM cluster on Exascale Infrastructure. + /// The number of ECPUs to enable for an Exadata VM cluster on Exascale Infrastructure. + /// The Azure Resource ID of the Exadata Database Storage Vault. + /// Grid Setup will be done using this Grid Image OCID. Can be obtained using giMinorVersions API. + /// The type of Grid Image. + /// Oracle Grid Infrastructure (GI) software version. + /// The hostname for the Exadata VM cluster on Exascale Infrastructure. + /// The Oracle license model that applies to the Exadata VM cluster on Exascale Infrastructure. The default is LICENSE_INCLUDED. + /// The memory that you want to be allocated in GBs. Memory is calculated based on 11 GB per VM core reserved. + /// The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + /// CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster will be added by default. + /// The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with. + /// The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with. + /// The TCP Single Client Access Name (SCAN) port. The default port is 1521. + /// The TCPS Single Client Access Name (SCAN) port. The default port is 2484. + /// The port number configured for the listener on the Exadata VM cluster on Exascale Infrastructure. + /// The shape of the Exadata VM cluster on Exascale Infrastructure resource. + /// The public key portion of one or more key pairs used for SSH access to the Exadata VM cluster on Exascale Infrastructure. + /// Operating system version of the image. + /// The time zone of the Exadata VM cluster on Exascale Infrastructure. For details, see [Exadata Infrastructure Time Zones](/Content/Database/References/timezones.htm). + /// The number of Total ECPUs for an Exadata VM cluster on Exascale Infrastructure. + /// Filesystem storage details. + /// Additional information about the current lifecycle state. + /// The FQDN of the DNS record for the SCAN IP addresses that are associated with the Exadata VM cluster on Exascale Infrastructure. + /// The Single Client Access Name (SCAN) IP addresses associated with the Exadata VM cluster on Exascale Infrastructure. SCAN IP addresses are typically used for load balancing and are not assigned to any interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. **Note:** For a single-node DB system, this list is empty. + /// The OCID of the DNS record for the SCAN IP addresses that are associated with the Exadata VM cluster on Exascale Infrastructure. + /// Snapshot filesystem storage details. + /// Total file system storage details. + /// The virtual IP (VIP) addresses associated with the Exadata VM cluster on Exascale Infrastructure. The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata Cloud Service instance to enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. **Note:** For a single-node DB system, this list is empty. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// iormConfigCache details for Exadata VM cluster on Exascale Infrastructure. + /// Cluster backup subnet ocid. + /// Cluster subnet ocid. + /// A new instance for mocking. + public static ExadbVmClusterProperties ExadbVmClusterProperties(string ocid = null, string clusterName = null, string backupSubnetCidr = null, Uri nsgUri = null, AzureResourceProvisioningState? provisioningState = null, ExadbVmClusterLifecycleState? lifecycleState = null, ResourceIdentifier vnetId = null, ResourceIdentifier subnetId = null, DataCollectionOptions dataCollectionOptions = null, string displayName = null, string domain = null, int enabledEcpuCount = default, ResourceIdentifier exascaleDbStorageVaultId = null, string gridImageOcid = null, GridImageType? gridImageType = null, string giVersion = null, string hostname = null, LicenseModel? licenseModel = null, int? memorySizeInGbs = null, int nodeCount = default, IEnumerable nsgCidrs = null, string zoneOcid = null, string privateZoneOcid = null, int? scanListenerPortTcp = null, int? scanListenerPortTcpSsl = null, int? listenerPort = null, string shape = null, IEnumerable sshPublicKeys = null, string systemVersion = null, string timeZone = null, int totalEcpuCount = default, int? vmFileSystemStorageTotalSizeInGbs = null, string lifecycleDetails = null, string scanDnsName = null, IEnumerable scanIPIds = null, string scanDnsRecordId = null, int? snapshotFileSystemStorageTotalSizeInGbs = null, int? totalSizeInGbs = null, IEnumerable vipIds = null, Uri ociUri = null, ExadataIormConfig iormConfigCache = null, string backupSubnetOcid = null, string subnetOcid = null) + { + nsgCidrs ??= new List(); + sshPublicKeys ??= new List(); + scanIPIds ??= new List(); + vipIds ??= new List(); + + return new ExadbVmClusterProperties( + ocid, + clusterName, + backupSubnetCidr, + nsgUri, + provisioningState, + lifecycleState, + vnetId, + subnetId, + dataCollectionOptions, + displayName, + domain, + enabledEcpuCount, + exascaleDbStorageVaultId, + gridImageOcid, + gridImageType, + giVersion, + hostname, + licenseModel, + memorySizeInGbs, + nodeCount, + nsgCidrs?.ToList(), + zoneOcid, + privateZoneOcid, + scanListenerPortTcp, + scanListenerPortTcpSsl, + listenerPort, + shape, + sshPublicKeys?.ToList(), + systemVersion, + timeZone, + totalEcpuCount, + vmFileSystemStorageTotalSizeInGbs.HasValue ? new ExadbVmClusterStorageDetails(vmFileSystemStorageTotalSizeInGbs.Value, serializedAdditionalRawData: null) : null, + lifecycleDetails, + scanDnsName, + scanIPIds?.ToList(), + scanDnsRecordId, + snapshotFileSystemStorageTotalSizeInGbs.HasValue ? new ExadbVmClusterStorageDetails(snapshotFileSystemStorageTotalSizeInGbs.Value, serializedAdditionalRawData: null) : null, + totalSizeInGbs.HasValue ? new ExadbVmClusterStorageDetails(totalSizeInGbs.Value, serializedAdditionalRawData: null) : null, + vipIds?.ToList(), + ociUri, + iormConfigCache, + backupSubnetOcid, + subnetOcid, + 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 ExascaleDbNodeData ExascaleDbNodeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ExascaleDbNodeProperties properties = null) + { + return new ExascaleDbNodeData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// DbNode OCID. + /// Additional information about the planned maintenance. + /// The number of CPU cores enabled on the Db node. + /// The allocated local node storage in GBs on the Db node. + /// The name of the Fault Domain the instance is contained in. + /// The host name for the database node. + /// The current state of the database node. + /// The type of database node maintenance. + /// The allocated memory in GBs on the Db node. + /// The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine DB systems. + /// End date and time of maintenance window. + /// Start date and time of maintenance window. + /// The total number of CPU cores reserved on the Db node. + /// A new instance for mocking. + public static ExascaleDbNodeProperties ExascaleDbNodeProperties(string ocid = null, string additionalDetails = null, int? cpuCoreCount = null, int? dbNodeStorageSizeInGbs = null, string faultDomain = null, string hostname = null, DbNodeProvisioningState? lifecycleState = null, string maintenanceType = null, int? memorySizeInGbs = null, int? softwareStorageSizeInGb = null, DateTimeOffset? timeMaintenanceWindowEnd = null, DateTimeOffset? timeMaintenanceWindowStart = null, int? totalCpuCoreCount = null) + { + return new ExascaleDbNodeProperties( + ocid, + additionalDetails, + cpuCoreCount, + dbNodeStorageSizeInGbs, + faultDomain, + hostname, + lifecycleState, + maintenanceType, + memorySizeInGbs, + softwareStorageSizeInGb, + timeMaintenanceWindowEnd, + timeMaintenanceWindowStart, + totalCpuCoreCount, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// ExascaleDbNode provisioning state. + /// A new instance for mocking. + public static DbActionResponse DbActionResponse(AzureResourceProvisioningState? provisioningState = null) + { + return new DbActionResponse(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 availability zones. + /// A new instance for mocking. + public static ExascaleDbStorageVaultData ExascaleDbStorageVaultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExascaleDbStorageVaultProperties properties = null, IEnumerable zones = null) + { + tags ??= new Dictionary(); + zones ??= new List(); + + return new ExascaleDbStorageVaultData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + zones?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The size of additional Flash Cache in percentage of High Capacity database storage. + /// Exadata Database Storage Vault description. + /// The user-friendly name for the Exadata Database Storage Vault. The name does not need to be unique. + /// Create exadata Database Storage Details. + /// Response exadata Database Storage Details. + /// The time zone that you want to use for the Exadata Database Storage Vault. + /// Exadata Database Storage Vault provisioning state. + /// Exadata Database Storage Vault lifecycle state. + /// Additional information about the current lifecycle state. + /// The number of Exadata VM clusters used the Exadata Database Storage Vault. + /// The OCID of the Exadata Database Storage Vault. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// A new instance for mocking. + public static ExascaleDbStorageVaultProperties ExascaleDbStorageVaultProperties(int? additionalFlashCacheInPercent = null, string description = null, string displayName = null, int? highCapacityDatabaseStorageInputTotalSizeInGbs = null, ExascaleDbStorageDetails highCapacityDatabaseStorage = null, string timeZone = null, AzureResourceProvisioningState? provisioningState = null, ExascaleDbStorageVaultLifecycleState? lifecycleState = null, string lifecycleDetails = null, int? vmClusterCount = null, string ocid = null, Uri ociUri = null) + { + return new ExascaleDbStorageVaultProperties( + additionalFlashCacheInPercent, + description, + displayName, + highCapacityDatabaseStorageInputTotalSizeInGbs.HasValue ? new ExascaleDbStorageInputDetails(highCapacityDatabaseStorageInputTotalSizeInGbs.Value, serializedAdditionalRawData: null) : null, + highCapacityDatabaseStorage, + timeZone, + provisioningState, + lifecycleState, + lifecycleDetails, + vmClusterCount, + ocid, + ociUri, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Available Capacity. + /// Total Capacity. + /// A new instance for mocking. + public static ExascaleDbStorageDetails ExascaleDbStorageDetails(int? availableSizeInGbs = null, int? totalSizeInGbs = null) + { + return new ExascaleDbStorageDetails(availableSizeInGbs, totalSizeInGbs, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupCollection.cs new file mode 100644 index 000000000000..4a448bf0bd28 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupCollection.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.OracleDatabase +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAutonomousDatabaseBackups method from an instance of . + /// + public partial class AutonomousDatabaseBackupCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _autonomousDatabaseBackupClientDiagnostics; + private readonly AutonomousDatabaseBackupsRestOperations _autonomousDatabaseBackupRestClient; + + /// Initializes a new instance of the class for mocking. + protected AutonomousDatabaseBackupCollection() + { + } + + /// 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 AutonomousDatabaseBackupCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _autonomousDatabaseBackupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", AutonomousDatabaseBackupResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AutonomousDatabaseBackupResource.ResourceType, out string autonomousDatabaseBackupApiVersion); + _autonomousDatabaseBackupRestClient = new AutonomousDatabaseBackupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autonomousDatabaseBackupApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != AutonomousDatabaseResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, AutonomousDatabaseResource.ResourceType), nameof(id)); + } + + /// + /// Create a AutonomousDatabaseBackup + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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. + /// AutonomousDatabaseBackup id. + /// Resource create parameters. + /// 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 adbbackupid, AutonomousDatabaseBackupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _autonomousDatabaseBackupClientDiagnostics.CreateScope("AutonomousDatabaseBackupCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _autonomousDatabaseBackupRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, adbbackupid, data, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseBackupOperationSource(Client), _autonomousDatabaseBackupClientDiagnostics, Pipeline, _autonomousDatabaseBackupRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, adbbackupid, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a AutonomousDatabaseBackup + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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. + /// AutonomousDatabaseBackup id. + /// Resource create parameters. + /// 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 adbbackupid, AutonomousDatabaseBackupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _autonomousDatabaseBackupClientDiagnostics.CreateScope("AutonomousDatabaseBackupCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _autonomousDatabaseBackupRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, adbbackupid, data, cancellationToken); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseBackupOperationSource(Client), _autonomousDatabaseBackupClientDiagnostics, Pipeline, _autonomousDatabaseBackupRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, adbbackupid, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutonomousDatabaseBackup + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseBackup id. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string adbbackupid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + + using var scope = _autonomousDatabaseBackupClientDiagnostics.CreateScope("AutonomousDatabaseBackupCollection.Get"); + scope.Start(); + try + { + var response = await _autonomousDatabaseBackupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, adbbackupid, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseBackupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutonomousDatabaseBackup + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseBackup id. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string adbbackupid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + + using var scope = _autonomousDatabaseBackupClientDiagnostics.CreateScope("AutonomousDatabaseBackupCollection.Get"); + scope.Start(); + try + { + var response = _autonomousDatabaseBackupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, adbbackupid, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseBackupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AutonomousDatabaseBackup resources by AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-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) => _autonomousDatabaseBackupRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autonomousDatabaseBackupRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutonomousDatabaseBackupResource(Client, AutonomousDatabaseBackupData.DeserializeAutonomousDatabaseBackupData(e)), _autonomousDatabaseBackupClientDiagnostics, Pipeline, "AutonomousDatabaseBackupCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AutonomousDatabaseBackup resources by AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-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) => _autonomousDatabaseBackupRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autonomousDatabaseBackupRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutonomousDatabaseBackupResource(Client, AutonomousDatabaseBackupData.DeserializeAutonomousDatabaseBackupData(e)), _autonomousDatabaseBackupClientDiagnostics, Pipeline, "AutonomousDatabaseBackupCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseBackup id. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string adbbackupid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + + using var scope = _autonomousDatabaseBackupClientDiagnostics.CreateScope("AutonomousDatabaseBackupCollection.Exists"); + scope.Start(); + try + { + var response = await _autonomousDatabaseBackupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, adbbackupid, 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/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseBackup id. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string adbbackupid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + + using var scope = _autonomousDatabaseBackupClientDiagnostics.CreateScope("AutonomousDatabaseBackupCollection.Exists"); + scope.Start(); + try + { + var response = _autonomousDatabaseBackupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, adbbackupid, 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/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseBackup id. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string adbbackupid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + + using var scope = _autonomousDatabaseBackupClientDiagnostics.CreateScope("AutonomousDatabaseBackupCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _autonomousDatabaseBackupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, adbbackupid, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseBackupResource(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/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseBackup id. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string adbbackupid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + + using var scope = _autonomousDatabaseBackupClientDiagnostics.CreateScope("AutonomousDatabaseBackupCollection.GetIfExists"); + scope.Start(); + try + { + var response = _autonomousDatabaseBackupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, adbbackupid, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseBackupResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupData.Serialization.cs new file mode 100644 index 000000000000..f3871e93f891 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class AutonomousDatabaseBackupData : 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(AutonomousDatabaseBackupData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + AutonomousDatabaseBackupData 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(AutonomousDatabaseBackupData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseBackupData(document.RootElement, options); + } + + internal static AutonomousDatabaseBackupData DeserializeAutonomousDatabaseBackupData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AutonomousDatabaseBackupProperties 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 = AutonomousDatabaseBackupProperties.DeserializeAutonomousDatabaseBackupProperties(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 AutonomousDatabaseBackupData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseBackupData)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseBackupData 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 DeserializeAutonomousDatabaseBackupData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseBackupData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupData.cs new file mode 100644 index 000000000000..19b1ef0b7c2c --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the AutonomousDatabaseBackup data model. + /// AutonomousDatabaseBackup resource definition + /// + public partial class AutonomousDatabaseBackupData : 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 AutonomousDatabaseBackupData() + { + } + + /// 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 AutonomousDatabaseBackupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AutonomousDatabaseBackupProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public AutonomousDatabaseBackupProperties Properties { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupResource.Serialization.cs new file mode 100644 index 000000000000..3599f43b0e53 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupResource.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.OracleDatabase +{ + public partial class AutonomousDatabaseBackupResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AutonomousDatabaseBackupData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AutonomousDatabaseBackupData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupResource.cs new file mode 100644 index 000000000000..23e02e0bf5a8 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseBackupResource.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.OracleDatabase +{ + /// + /// A Class representing an AutonomousDatabaseBackup along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAutonomousDatabaseBackupResource method. + /// Otherwise you can get one from its parent resource using the GetAutonomousDatabaseBackup method. + /// + public partial class AutonomousDatabaseBackupResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The autonomousdatabasename. + /// The adbbackupid. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string autonomousdatabasename, string adbbackupid) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _autonomousDatabaseBackupClientDiagnostics; + private readonly AutonomousDatabaseBackupsRestOperations _autonomousDatabaseBackupRestClient; + private readonly AutonomousDatabaseBackupData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/autonomousDatabases/autonomousDatabaseBackups"; + + /// Initializes a new instance of the class for mocking. + protected AutonomousDatabaseBackupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AutonomousDatabaseBackupResource(ArmClient client, AutonomousDatabaseBackupData 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 AutonomousDatabaseBackupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _autonomousDatabaseBackupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string autonomousDatabaseBackupApiVersion); + _autonomousDatabaseBackupRestClient = new AutonomousDatabaseBackupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autonomousDatabaseBackupApiVersion); +#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 AutonomousDatabaseBackupData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a AutonomousDatabaseBackup + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _autonomousDatabaseBackupClientDiagnostics.CreateScope("AutonomousDatabaseBackupResource.Get"); + scope.Start(); + try + { + var response = await _autonomousDatabaseBackupRestClient.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 AutonomousDatabaseBackupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutonomousDatabaseBackup + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _autonomousDatabaseBackupClientDiagnostics.CreateScope("AutonomousDatabaseBackupResource.Get"); + scope.Start(); + try + { + var response = _autonomousDatabaseBackupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseBackupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a AutonomousDatabaseBackup + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _autonomousDatabaseBackupClientDiagnostics.CreateScope("AutonomousDatabaseBackupResource.Delete"); + scope.Start(); + try + { + var response = await _autonomousDatabaseBackupRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_autonomousDatabaseBackupClientDiagnostics, Pipeline, _autonomousDatabaseBackupRestClient.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; + } + } + + /// + /// Delete a AutonomousDatabaseBackup + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _autonomousDatabaseBackupClientDiagnostics.CreateScope("AutonomousDatabaseBackupResource.Delete"); + scope.Start(); + try + { + var response = _autonomousDatabaseBackupRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new OracleDatabaseArmOperation(_autonomousDatabaseBackupClientDiagnostics, Pipeline, _autonomousDatabaseBackupRestClient.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; + } + } + + /// + /// Update a AutonomousDatabaseBackup + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, AutonomousDatabaseBackupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _autonomousDatabaseBackupClientDiagnostics.CreateScope("AutonomousDatabaseBackupResource.Update"); + scope.Start(); + try + { + var response = await _autonomousDatabaseBackupRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseBackupOperationSource(Client), _autonomousDatabaseBackupClientDiagnostics, Pipeline, _autonomousDatabaseBackupRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a AutonomousDatabaseBackup + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, AutonomousDatabaseBackupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _autonomousDatabaseBackupClientDiagnostics.CreateScope("AutonomousDatabaseBackupResource.Update"); + scope.Start(); + try + { + var response = _autonomousDatabaseBackupRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseBackupOperationSource(Client), _autonomousDatabaseBackupClientDiagnostics, Pipeline, _autonomousDatabaseBackupRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetCollection.cs new file mode 100644 index 000000000000..607737ad2855 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetCollection.cs @@ -0,0 +1,399 @@ +// 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.OracleDatabase +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAutonomousDatabaseCharacterSets method from an instance of . + /// + public partial class AutonomousDatabaseCharacterSetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _autonomousDatabaseCharacterSetClientDiagnostics; + private readonly AutonomousDatabaseCharacterSetsRestOperations _autonomousDatabaseCharacterSetRestClient; + private readonly AzureLocation _location; + + /// Initializes a new instance of the class for mocking. + protected AutonomousDatabaseCharacterSetCollection() + { + } + + /// 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. + /// The name of the Azure region. + internal AutonomousDatabaseCharacterSetCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) + { + _location = location; + _autonomousDatabaseCharacterSetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", AutonomousDatabaseCharacterSetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AutonomousDatabaseCharacterSetResource.ResourceType, out string autonomousDatabaseCharacterSetApiVersion); + _autonomousDatabaseCharacterSetRestClient = new AutonomousDatabaseCharacterSetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autonomousDatabaseCharacterSetApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Get a AutonomousDatabaseCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseCharacterSet 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 adbscharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbscharsetname, nameof(adbscharsetname)); + + using var scope = _autonomousDatabaseCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseCharacterSetCollection.Get"); + scope.Start(); + try + { + var response = await _autonomousDatabaseCharacterSetRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), adbscharsetname, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseCharacterSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutonomousDatabaseCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseCharacterSet name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string adbscharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbscharsetname, nameof(adbscharsetname)); + + using var scope = _autonomousDatabaseCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseCharacterSetCollection.Get"); + scope.Start(); + try + { + var response = _autonomousDatabaseCharacterSetRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), adbscharsetname, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseCharacterSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets + /// + /// + /// Operation Id + /// AutonomousDatabaseCharacterSet_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-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) => _autonomousDatabaseCharacterSetRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autonomousDatabaseCharacterSetRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutonomousDatabaseCharacterSetResource(Client, AutonomousDatabaseCharacterSetData.DeserializeAutonomousDatabaseCharacterSetData(e)), _autonomousDatabaseCharacterSetClientDiagnostics, Pipeline, "AutonomousDatabaseCharacterSetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets + /// + /// + /// Operation Id + /// AutonomousDatabaseCharacterSet_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-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) => _autonomousDatabaseCharacterSetRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autonomousDatabaseCharacterSetRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutonomousDatabaseCharacterSetResource(Client, AutonomousDatabaseCharacterSetData.DeserializeAutonomousDatabaseCharacterSetData(e)), _autonomousDatabaseCharacterSetClientDiagnostics, Pipeline, "AutonomousDatabaseCharacterSetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseCharacterSet 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 adbscharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbscharsetname, nameof(adbscharsetname)); + + using var scope = _autonomousDatabaseCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseCharacterSetCollection.Exists"); + scope.Start(); + try + { + var response = await _autonomousDatabaseCharacterSetRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), adbscharsetname, 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}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseCharacterSet name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string adbscharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbscharsetname, nameof(adbscharsetname)); + + using var scope = _autonomousDatabaseCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseCharacterSetCollection.Exists"); + scope.Start(); + try + { + var response = _autonomousDatabaseCharacterSetRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), adbscharsetname, 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}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseCharacterSet 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 adbscharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbscharsetname, nameof(adbscharsetname)); + + using var scope = _autonomousDatabaseCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseCharacterSetCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _autonomousDatabaseCharacterSetRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), adbscharsetname, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseCharacterSetResource(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}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseCharacterSet name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string adbscharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbscharsetname, nameof(adbscharsetname)); + + using var scope = _autonomousDatabaseCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseCharacterSetCollection.GetIfExists"); + scope.Start(); + try + { + var response = _autonomousDatabaseCharacterSetRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), adbscharsetname, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseCharacterSetResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetData.Serialization.cs new file mode 100644 index 000000000000..6c6caea1a3a0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class AutonomousDatabaseCharacterSetData : 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(AutonomousDatabaseCharacterSetData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + AutonomousDatabaseCharacterSetData 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(AutonomousDatabaseCharacterSetData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseCharacterSetData(document.RootElement, options); + } + + internal static AutonomousDatabaseCharacterSetData DeserializeAutonomousDatabaseCharacterSetData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AutonomousDatabaseCharacterSetProperties 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 = AutonomousDatabaseCharacterSetProperties.DeserializeAutonomousDatabaseCharacterSetProperties(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 AutonomousDatabaseCharacterSetData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseCharacterSetData)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseCharacterSetData 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 DeserializeAutonomousDatabaseCharacterSetData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseCharacterSetData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetData.cs new file mode 100644 index 000000000000..f192e212cf4c --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetData.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; +using Azure.ResourceManager.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the AutonomousDatabaseCharacterSet data model. + /// AutonomousDatabaseCharacterSets resource definition + /// + public partial class AutonomousDatabaseCharacterSetData : 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 AutonomousDatabaseCharacterSetData() + { + } + + /// 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 AutonomousDatabaseCharacterSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AutonomousDatabaseCharacterSetProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + internal AutonomousDatabaseCharacterSetProperties Properties { get; } + /// The Oracle Autonomous Database supported character sets. + public string AutonomousDatabaseCharacterSet + { + get => Properties?.CharacterSet; + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetResource.Serialization.cs new file mode 100644 index 000000000000..b5fa9ead5207 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetResource.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.OracleDatabase +{ + public partial class AutonomousDatabaseCharacterSetResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AutonomousDatabaseCharacterSetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AutonomousDatabaseCharacterSetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetResource.cs new file mode 100644 index 000000000000..333556dcd19a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCharacterSetResource.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; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing an AutonomousDatabaseCharacterSet along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAutonomousDatabaseCharacterSetResource method. + /// Otherwise you can get one from its parent resource using the GetAutonomousDatabaseCharacterSet method. + /// + public partial class AutonomousDatabaseCharacterSetResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The location. + /// The adbscharsetname. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string adbscharsetname) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _autonomousDatabaseCharacterSetClientDiagnostics; + private readonly AutonomousDatabaseCharacterSetsRestOperations _autonomousDatabaseCharacterSetRestClient; + private readonly AutonomousDatabaseCharacterSetData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/locations/autonomousDatabaseCharacterSets"; + + /// Initializes a new instance of the class for mocking. + protected AutonomousDatabaseCharacterSetResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AutonomousDatabaseCharacterSetResource(ArmClient client, AutonomousDatabaseCharacterSetData 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 AutonomousDatabaseCharacterSetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _autonomousDatabaseCharacterSetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string autonomousDatabaseCharacterSetApiVersion); + _autonomousDatabaseCharacterSetRestClient = new AutonomousDatabaseCharacterSetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autonomousDatabaseCharacterSetApiVersion); +#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 AutonomousDatabaseCharacterSetData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a AutonomousDatabaseCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _autonomousDatabaseCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseCharacterSetResource.Get"); + scope.Start(); + try + { + var response = await _autonomousDatabaseCharacterSetRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseCharacterSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutonomousDatabaseCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _autonomousDatabaseCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseCharacterSetResource.Get"); + scope.Start(); + try + { + var response = _autonomousDatabaseCharacterSetRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseCharacterSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCollection.cs new file mode 100644 index 000000000000..ce29865dfb26 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseCollection.cs @@ -0,0 +1,494 @@ +// 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.OracleDatabase +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAutonomousDatabases method from an instance of . + /// + public partial class AutonomousDatabaseCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _autonomousDatabaseClientDiagnostics; + private readonly AutonomousDatabasesRestOperations _autonomousDatabaseRestClient; + + /// Initializes a new instance of the class for mocking. + protected AutonomousDatabaseCollection() + { + } + + /// 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 AutonomousDatabaseCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _autonomousDatabaseClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", AutonomousDatabaseResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AutonomousDatabaseResource.ResourceType, out string autonomousDatabaseApiVersion); + _autonomousDatabaseRestClient = new AutonomousDatabasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autonomousDatabaseApiVersion); +#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)); + } + + /// + /// Create a AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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 database name. + /// Resource create parameters. + /// 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 autonomousdatabasename, AutonomousDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _autonomousDatabaseRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, autonomousdatabasename, data, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, autonomousdatabasename, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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 database name. + /// Resource create parameters. + /// 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 autonomousdatabasename, AutonomousDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _autonomousDatabaseRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, autonomousdatabasename, data, cancellationToken); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, autonomousdatabasename, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database 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 autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseCollection.Get"); + scope.Start(); + try + { + var response = await _autonomousDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, autonomousdatabasename, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseCollection.Get"); + scope.Start(); + try + { + var response = _autonomousDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, autonomousdatabasename, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AutonomousDatabase resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases + /// + /// + /// Operation Id + /// AutonomousDatabase_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-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) => _autonomousDatabaseRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autonomousDatabaseRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutonomousDatabaseResource(Client, AutonomousDatabaseData.DeserializeAutonomousDatabaseData(e)), _autonomousDatabaseClientDiagnostics, Pipeline, "AutonomousDatabaseCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AutonomousDatabase resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases + /// + /// + /// Operation Id + /// AutonomousDatabase_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-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) => _autonomousDatabaseRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autonomousDatabaseRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutonomousDatabaseResource(Client, AutonomousDatabaseData.DeserializeAutonomousDatabaseData(e)), _autonomousDatabaseClientDiagnostics, Pipeline, "AutonomousDatabaseCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database 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 autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseCollection.Exists"); + scope.Start(); + try + { + var response = await _autonomousDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, autonomousdatabasename, 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/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseCollection.Exists"); + scope.Start(); + try + { + var response = _autonomousDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, autonomousdatabasename, 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/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database 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 autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _autonomousDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, autonomousdatabasename, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseResource(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/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseCollection.GetIfExists"); + scope.Start(); + try + { + var response = _autonomousDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, autonomousdatabasename, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseData.Serialization.cs new file mode 100644 index 000000000000..c351ab86c8fe --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class AutonomousDatabaseData : 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(AutonomousDatabaseData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + AutonomousDatabaseData 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(AutonomousDatabaseData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseData(document.RootElement, options); + } + + internal static AutonomousDatabaseData DeserializeAutonomousDatabaseData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AutonomousDatabaseBaseProperties 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 = AutonomousDatabaseBaseProperties.DeserializeAutonomousDatabaseBaseProperties(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 AutonomousDatabaseData( + 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); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseData)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseData 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 DeserializeAutonomousDatabaseData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseData.cs new file mode 100644 index 000000000000..c2af47340c97 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseData.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the AutonomousDatabase data model. + /// Autonomous Database resource model. + /// + public partial class AutonomousDatabaseData : 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 AutonomousDatabaseData(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. + /// 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 AutonomousDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, AutonomousDatabaseBaseProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDatabaseData() + { + } + + /// + /// The resource-specific properties for this resource. + /// 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 AutonomousDatabaseBaseProperties Properties { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetCollection.cs new file mode 100644 index 000000000000..5b3bdf95f6a0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetCollection.cs @@ -0,0 +1,399 @@ +// 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.OracleDatabase +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAutonomousDatabaseNationalCharacterSets method from an instance of . + /// + public partial class AutonomousDatabaseNationalCharacterSetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _autonomousDatabaseNationalCharacterSetClientDiagnostics; + private readonly AutonomousDatabaseNationalCharacterSetsRestOperations _autonomousDatabaseNationalCharacterSetRestClient; + private readonly AzureLocation _location; + + /// Initializes a new instance of the class for mocking. + protected AutonomousDatabaseNationalCharacterSetCollection() + { + } + + /// 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. + /// The name of the Azure region. + internal AutonomousDatabaseNationalCharacterSetCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) + { + _location = location; + _autonomousDatabaseNationalCharacterSetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", AutonomousDatabaseNationalCharacterSetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AutonomousDatabaseNationalCharacterSetResource.ResourceType, out string autonomousDatabaseNationalCharacterSetApiVersion); + _autonomousDatabaseNationalCharacterSetRestClient = new AutonomousDatabaseNationalCharacterSetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autonomousDatabaseNationalCharacterSetApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Get a AutonomousDatabaseNationalCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseNationalCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseNationalCharacterSets 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 adbsncharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbsncharsetname, nameof(adbsncharsetname)); + + using var scope = _autonomousDatabaseNationalCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseNationalCharacterSetCollection.Get"); + scope.Start(); + try + { + var response = await _autonomousDatabaseNationalCharacterSetRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), adbsncharsetname, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseNationalCharacterSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutonomousDatabaseNationalCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseNationalCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseNationalCharacterSets name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string adbsncharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbsncharsetname, nameof(adbsncharsetname)); + + using var scope = _autonomousDatabaseNationalCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseNationalCharacterSetCollection.Get"); + scope.Start(); + try + { + var response = _autonomousDatabaseNationalCharacterSetRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), adbsncharsetname, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseNationalCharacterSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets + /// + /// + /// Operation Id + /// AutonomousDatabaseNationalCharacterSet_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-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) => _autonomousDatabaseNationalCharacterSetRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autonomousDatabaseNationalCharacterSetRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutonomousDatabaseNationalCharacterSetResource(Client, AutonomousDatabaseNationalCharacterSetData.DeserializeAutonomousDatabaseNationalCharacterSetData(e)), _autonomousDatabaseNationalCharacterSetClientDiagnostics, Pipeline, "AutonomousDatabaseNationalCharacterSetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets + /// + /// + /// Operation Id + /// AutonomousDatabaseNationalCharacterSet_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-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) => _autonomousDatabaseNationalCharacterSetRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autonomousDatabaseNationalCharacterSetRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutonomousDatabaseNationalCharacterSetResource(Client, AutonomousDatabaseNationalCharacterSetData.DeserializeAutonomousDatabaseNationalCharacterSetData(e)), _autonomousDatabaseNationalCharacterSetClientDiagnostics, Pipeline, "AutonomousDatabaseNationalCharacterSetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseNationalCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseNationalCharacterSets 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 adbsncharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbsncharsetname, nameof(adbsncharsetname)); + + using var scope = _autonomousDatabaseNationalCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseNationalCharacterSetCollection.Exists"); + scope.Start(); + try + { + var response = await _autonomousDatabaseNationalCharacterSetRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), adbsncharsetname, 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}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseNationalCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseNationalCharacterSets name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string adbsncharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbsncharsetname, nameof(adbsncharsetname)); + + using var scope = _autonomousDatabaseNationalCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseNationalCharacterSetCollection.Exists"); + scope.Start(); + try + { + var response = _autonomousDatabaseNationalCharacterSetRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), adbsncharsetname, 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}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseNationalCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseNationalCharacterSets 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 adbsncharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbsncharsetname, nameof(adbsncharsetname)); + + using var scope = _autonomousDatabaseNationalCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseNationalCharacterSetCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _autonomousDatabaseNationalCharacterSetRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), adbsncharsetname, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseNationalCharacterSetResource(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}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseNationalCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseNationalCharacterSets name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string adbsncharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(adbsncharsetname, nameof(adbsncharsetname)); + + using var scope = _autonomousDatabaseNationalCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseNationalCharacterSetCollection.GetIfExists"); + scope.Start(); + try + { + var response = _autonomousDatabaseNationalCharacterSetRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), adbsncharsetname, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseNationalCharacterSetResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetData.Serialization.cs new file mode 100644 index 000000000000..093c403f850e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class AutonomousDatabaseNationalCharacterSetData : 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(AutonomousDatabaseNationalCharacterSetData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + AutonomousDatabaseNationalCharacterSetData 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(AutonomousDatabaseNationalCharacterSetData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseNationalCharacterSetData(document.RootElement, options); + } + + internal static AutonomousDatabaseNationalCharacterSetData DeserializeAutonomousDatabaseNationalCharacterSetData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AutonomousDatabaseNationalCharacterSetProperties 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 = AutonomousDatabaseNationalCharacterSetProperties.DeserializeAutonomousDatabaseNationalCharacterSetProperties(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 AutonomousDatabaseNationalCharacterSetData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseNationalCharacterSetData)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseNationalCharacterSetData 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 DeserializeAutonomousDatabaseNationalCharacterSetData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseNationalCharacterSetData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetData.cs new file mode 100644 index 000000000000..122e111db9b2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetData.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; +using Azure.ResourceManager.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the AutonomousDatabaseNationalCharacterSet data model. + /// AutonomousDatabaseNationalCharacterSets resource definition + /// + public partial class AutonomousDatabaseNationalCharacterSetData : 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 AutonomousDatabaseNationalCharacterSetData() + { + } + + /// 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 AutonomousDatabaseNationalCharacterSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AutonomousDatabaseNationalCharacterSetProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + internal AutonomousDatabaseNationalCharacterSetProperties Properties { get; } + /// The Oracle Autonomous Database supported national character sets. + public string AutonomousDatabaseNationalCharacterSet + { + get => Properties?.CharacterSet; + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetResource.Serialization.cs new file mode 100644 index 000000000000..47ce9c0ddb44 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetResource.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.OracleDatabase +{ + public partial class AutonomousDatabaseNationalCharacterSetResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AutonomousDatabaseNationalCharacterSetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AutonomousDatabaseNationalCharacterSetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetResource.cs new file mode 100644 index 000000000000..2533caaa2c6f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseNationalCharacterSetResource.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; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing an AutonomousDatabaseNationalCharacterSet along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAutonomousDatabaseNationalCharacterSetResource method. + /// Otherwise you can get one from its parent resource using the GetAutonomousDatabaseNationalCharacterSet method. + /// + public partial class AutonomousDatabaseNationalCharacterSetResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The location. + /// The adbsncharsetname. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string adbsncharsetname) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _autonomousDatabaseNationalCharacterSetClientDiagnostics; + private readonly AutonomousDatabaseNationalCharacterSetsRestOperations _autonomousDatabaseNationalCharacterSetRestClient; + private readonly AutonomousDatabaseNationalCharacterSetData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/locations/autonomousDatabaseNationalCharacterSets"; + + /// Initializes a new instance of the class for mocking. + protected AutonomousDatabaseNationalCharacterSetResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AutonomousDatabaseNationalCharacterSetResource(ArmClient client, AutonomousDatabaseNationalCharacterSetData 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 AutonomousDatabaseNationalCharacterSetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _autonomousDatabaseNationalCharacterSetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string autonomousDatabaseNationalCharacterSetApiVersion); + _autonomousDatabaseNationalCharacterSetRestClient = new AutonomousDatabaseNationalCharacterSetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autonomousDatabaseNationalCharacterSetApiVersion); +#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 AutonomousDatabaseNationalCharacterSetData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a AutonomousDatabaseNationalCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseNationalCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _autonomousDatabaseNationalCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseNationalCharacterSetResource.Get"); + scope.Start(); + try + { + var response = await _autonomousDatabaseNationalCharacterSetRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseNationalCharacterSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutonomousDatabaseNationalCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseNationalCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _autonomousDatabaseNationalCharacterSetClientDiagnostics.CreateScope("AutonomousDatabaseNationalCharacterSetResource.Get"); + scope.Start(); + try + { + var response = _autonomousDatabaseNationalCharacterSetRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseNationalCharacterSetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseResource.Serialization.cs new file mode 100644 index 000000000000..9c32a64fd3d5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseResource.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.OracleDatabase +{ + public partial class AutonomousDatabaseResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AutonomousDatabaseData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AutonomousDatabaseData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseResource.cs new file mode 100644 index 000000000000..d9a80c781815 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDatabaseResource.cs @@ -0,0 +1,1312 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing an AutonomousDatabase along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAutonomousDatabaseResource method. + /// Otherwise you can get one from its parent resource using the GetAutonomousDatabase method. + /// + public partial class AutonomousDatabaseResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The autonomousdatabasename. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string autonomousdatabasename) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _autonomousDatabaseClientDiagnostics; + private readonly AutonomousDatabasesRestOperations _autonomousDatabaseRestClient; + private readonly AutonomousDatabaseData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/autonomousDatabases"; + + /// Initializes a new instance of the class for mocking. + protected AutonomousDatabaseResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AutonomousDatabaseResource(ArmClient client, AutonomousDatabaseData 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 AutonomousDatabaseResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _autonomousDatabaseClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string autonomousDatabaseApiVersion); + _autonomousDatabaseRestClient = new AutonomousDatabasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autonomousDatabaseApiVersion); +#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 AutonomousDatabaseData 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 AutonomousDatabaseBackupResources in the AutonomousDatabase. + /// An object representing collection of AutonomousDatabaseBackupResources and their operations over a AutonomousDatabaseBackupResource. + public virtual AutonomousDatabaseBackupCollection GetAutonomousDatabaseBackups() + { + return GetCachedClient(client => new AutonomousDatabaseBackupCollection(client, Id)); + } + + /// + /// Get a AutonomousDatabaseBackup + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseBackup id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutonomousDatabaseBackupAsync(string adbbackupid, CancellationToken cancellationToken = default) + { + return await GetAutonomousDatabaseBackups().GetAsync(adbbackupid, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AutonomousDatabaseBackup + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/autonomousDatabaseBackups/{adbbackupid} + /// + /// + /// Operation Id + /// AutonomousDatabaseBackup_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDatabaseBackup id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutonomousDatabaseBackup(string adbbackupid, CancellationToken cancellationToken = default) + { + return GetAutonomousDatabaseBackups().Get(adbbackupid, cancellationToken); + } + + /// + /// Get a AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.Get"); + scope.Start(); + try + { + var response = await _autonomousDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.Get"); + scope.Start(); + try + { + var response = _autonomousDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.Delete"); + scope.Start(); + try + { + var response = await _autonomousDatabaseRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.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; + } + } + + /// + /// Delete a AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.Delete"); + scope.Start(); + try + { + var response = _autonomousDatabaseRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new OracleDatabaseArmOperation(_autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.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; + } + } + + /// + /// Update a AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, AutonomousDatabasePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.Update"); + scope.Start(); + try + { + var response = await _autonomousDatabaseRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.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; + } + } + + /// + /// Update a AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, AutonomousDatabasePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.Update"); + scope.Start(); + try + { + var response = _autonomousDatabaseRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.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; + } + } + + /// + /// Perform switchover action on Autonomous Database + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/switchover + /// + /// + /// Operation Id + /// AutonomousDatabases_Switchover + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> SwitchoverAsync(WaitUntil waitUntil, PeerDbDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.Switchover"); + scope.Start(); + try + { + var response = await _autonomousDatabaseRestClient.SwitchoverAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.CreateSwitchoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Perform switchover action on Autonomous Database + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/switchover + /// + /// + /// Operation Id + /// AutonomousDatabases_Switchover + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Switchover(WaitUntil waitUntil, PeerDbDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.Switchover"); + scope.Start(); + try + { + var response = _autonomousDatabaseRestClient.Switchover(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.CreateSwitchoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Perform failover action on Autonomous Database + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/failover + /// + /// + /// Operation Id + /// AutonomousDatabases_Failover + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> FailoverAsync(WaitUntil waitUntil, PeerDbDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.Failover"); + scope.Start(); + try + { + var response = await _autonomousDatabaseRestClient.FailoverAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.CreateFailoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Perform failover action on Autonomous Database + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/failover + /// + /// + /// Operation Id + /// AutonomousDatabases_Failover + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Failover(WaitUntil waitUntil, PeerDbDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.Failover"); + scope.Start(); + try + { + var response = _autonomousDatabaseRestClient.Failover(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.CreateFailoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Generate wallet action on Autonomous Database + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/generateWallet + /// + /// + /// Operation Id + /// AutonomousDatabases_GenerateWallet + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> GenerateWalletAsync(GenerateAutonomousDatabaseWalletDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.GenerateWallet"); + scope.Start(); + try + { + var response = await _autonomousDatabaseRestClient.GenerateWalletAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Generate wallet action on Autonomous Database + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/generateWallet + /// + /// + /// Operation Id + /// AutonomousDatabases_GenerateWallet + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual Response GenerateWallet(GenerateAutonomousDatabaseWalletDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.GenerateWallet"); + scope.Start(); + try + { + var response = _autonomousDatabaseRestClient.GenerateWallet(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Restores an Autonomous Database based on the provided request parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/restore + /// + /// + /// Operation Id + /// AutonomousDatabases_Restore + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> RestoreAsync(WaitUntil waitUntil, RestoreAutonomousDatabaseDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.Restore"); + scope.Start(); + try + { + var response = await _autonomousDatabaseRestClient.RestoreAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.CreateRestoreRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Restores an Autonomous Database based on the provided request parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/restore + /// + /// + /// Operation Id + /// AutonomousDatabases_Restore + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Restore(WaitUntil waitUntil, RestoreAutonomousDatabaseDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.Restore"); + scope.Start(); + try + { + var response = _autonomousDatabaseRestClient.Restore(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.CreateRestoreRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This operation shrinks the current allocated storage down to the current actual used data storage. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/shrink + /// + /// + /// Operation Id + /// AutonomousDatabases_Shrink + /// + /// + /// Default Api Version + /// 2025-03-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> ShrinkAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.Shrink"); + scope.Start(); + try + { + var response = await _autonomousDatabaseRestClient.ShrinkAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.CreateShrinkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This operation shrinks the current allocated storage down to the current actual used data storage. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/shrink + /// + /// + /// Operation Id + /// AutonomousDatabases_Shrink + /// + /// + /// Default Api Version + /// 2025-03-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 Shrink(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.Shrink"); + scope.Start(); + try + { + var response = _autonomousDatabaseRestClient.Shrink(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.CreateShrinkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/changeDisasterRecoveryConfiguration + /// + /// + /// Operation Id + /// AutonomousDatabases_ChangeDisasterRecoveryConfiguration + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> ChangeDisasterRecoveryConfigurationAsync(WaitUntil waitUntil, DisasterRecoveryConfigurationDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.ChangeDisasterRecoveryConfiguration"); + scope.Start(); + try + { + var response = await _autonomousDatabaseRestClient.ChangeDisasterRecoveryConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.CreateChangeDisasterRecoveryConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename}/changeDisasterRecoveryConfiguration + /// + /// + /// Operation Id + /// AutonomousDatabases_ChangeDisasterRecoveryConfiguration + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation ChangeDisasterRecoveryConfiguration(WaitUntil waitUntil, DisasterRecoveryConfigurationDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.ChangeDisasterRecoveryConfiguration"); + scope.Start(); + try + { + var response = _autonomousDatabaseRestClient.ChangeDisasterRecoveryConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken); + var operation = new OracleDatabaseArmOperation(new AutonomousDatabaseOperationSource(Client), _autonomousDatabaseClientDiagnostics, Pipeline, _autonomousDatabaseRestClient.CreateChangeDisasterRecoveryConfigurationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details).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/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.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 _autonomousDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AutonomousDatabaseResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new AutonomousDatabasePatch(); + 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/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.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 = _autonomousDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AutonomousDatabaseResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new AutonomousDatabasePatch(); + 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/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.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 _autonomousDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AutonomousDatabaseResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new AutonomousDatabasePatch(); + 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/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.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 = _autonomousDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AutonomousDatabaseResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new AutonomousDatabasePatch(); + 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/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.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 _autonomousDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AutonomousDatabaseResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new AutonomousDatabasePatch(); + 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/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _autonomousDatabaseClientDiagnostics.CreateScope("AutonomousDatabaseResource.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 = _autonomousDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AutonomousDatabaseResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new AutonomousDatabasePatch(); + 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionCollection.cs new file mode 100644 index 000000000000..5a3725efb0c0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionCollection.cs @@ -0,0 +1,399 @@ +// 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.OracleDatabase +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAutonomousDbVersions method from an instance of . + /// + public partial class AutonomousDbVersionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _autonomousDbVersionAutonomousDatabaseVersionsClientDiagnostics; + private readonly AutonomousDatabaseVersionsRestOperations _autonomousDbVersionAutonomousDatabaseVersionsRestClient; + private readonly AzureLocation _location; + + /// Initializes a new instance of the class for mocking. + protected AutonomousDbVersionCollection() + { + } + + /// 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. + /// The name of the Azure region. + internal AutonomousDbVersionCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) + { + _location = location; + _autonomousDbVersionAutonomousDatabaseVersionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", AutonomousDbVersionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AutonomousDbVersionResource.ResourceType, out string autonomousDbVersionAutonomousDatabaseVersionsApiVersion); + _autonomousDbVersionAutonomousDatabaseVersionsRestClient = new AutonomousDatabaseVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autonomousDbVersionAutonomousDatabaseVersionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Get a AutonomousDbVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname} + /// + /// + /// Operation Id + /// AutonomousDbVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDbVersion 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 autonomousdbversionsname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autonomousdbversionsname, nameof(autonomousdbversionsname)); + + using var scope = _autonomousDbVersionAutonomousDatabaseVersionsClientDiagnostics.CreateScope("AutonomousDbVersionCollection.Get"); + scope.Start(); + try + { + var response = await _autonomousDbVersionAutonomousDatabaseVersionsRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), autonomousdbversionsname, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDbVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutonomousDbVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname} + /// + /// + /// Operation Id + /// AutonomousDbVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDbVersion name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string autonomousdbversionsname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autonomousdbversionsname, nameof(autonomousdbversionsname)); + + using var scope = _autonomousDbVersionAutonomousDatabaseVersionsClientDiagnostics.CreateScope("AutonomousDbVersionCollection.Get"); + scope.Start(); + try + { + var response = _autonomousDbVersionAutonomousDatabaseVersionsRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), autonomousdbversionsname, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDbVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AutonomousDbVersion resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions + /// + /// + /// Operation Id + /// AutonomousDbVersion_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-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) => _autonomousDbVersionAutonomousDatabaseVersionsRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autonomousDbVersionAutonomousDatabaseVersionsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutonomousDbVersionResource(Client, AutonomousDbVersionData.DeserializeAutonomousDbVersionData(e)), _autonomousDbVersionAutonomousDatabaseVersionsClientDiagnostics, Pipeline, "AutonomousDbVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AutonomousDbVersion resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions + /// + /// + /// Operation Id + /// AutonomousDbVersion_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-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) => _autonomousDbVersionAutonomousDatabaseVersionsRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autonomousDbVersionAutonomousDatabaseVersionsRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutonomousDbVersionResource(Client, AutonomousDbVersionData.DeserializeAutonomousDbVersionData(e)), _autonomousDbVersionAutonomousDatabaseVersionsClientDiagnostics, Pipeline, "AutonomousDbVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname} + /// + /// + /// Operation Id + /// AutonomousDbVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDbVersion 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 autonomousdbversionsname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autonomousdbversionsname, nameof(autonomousdbversionsname)); + + using var scope = _autonomousDbVersionAutonomousDatabaseVersionsClientDiagnostics.CreateScope("AutonomousDbVersionCollection.Exists"); + scope.Start(); + try + { + var response = await _autonomousDbVersionAutonomousDatabaseVersionsRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), autonomousdbversionsname, 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}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname} + /// + /// + /// Operation Id + /// AutonomousDbVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDbVersion name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string autonomousdbversionsname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autonomousdbversionsname, nameof(autonomousdbversionsname)); + + using var scope = _autonomousDbVersionAutonomousDatabaseVersionsClientDiagnostics.CreateScope("AutonomousDbVersionCollection.Exists"); + scope.Start(); + try + { + var response = _autonomousDbVersionAutonomousDatabaseVersionsRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), autonomousdbversionsname, 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}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname} + /// + /// + /// Operation Id + /// AutonomousDbVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDbVersion 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 autonomousdbversionsname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autonomousdbversionsname, nameof(autonomousdbversionsname)); + + using var scope = _autonomousDbVersionAutonomousDatabaseVersionsClientDiagnostics.CreateScope("AutonomousDbVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _autonomousDbVersionAutonomousDatabaseVersionsRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), autonomousdbversionsname, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AutonomousDbVersionResource(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}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname} + /// + /// + /// Operation Id + /// AutonomousDbVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// AutonomousDbVersion name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string autonomousdbversionsname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autonomousdbversionsname, nameof(autonomousdbversionsname)); + + using var scope = _autonomousDbVersionAutonomousDatabaseVersionsClientDiagnostics.CreateScope("AutonomousDbVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _autonomousDbVersionAutonomousDatabaseVersionsRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), autonomousdbversionsname, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AutonomousDbVersionResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionData.Serialization.cs new file mode 100644 index 000000000000..7c1863aa8fa9 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class AutonomousDbVersionData : 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(AutonomousDbVersionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + AutonomousDbVersionData 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(AutonomousDbVersionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDbVersionData(document.RootElement, options); + } + + internal static AutonomousDbVersionData DeserializeAutonomousDbVersionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AutonomousDbVersionProperties 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 = AutonomousDbVersionProperties.DeserializeAutonomousDbVersionProperties(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 AutonomousDbVersionData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutonomousDbVersionData)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDbVersionData 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 DeserializeAutonomousDbVersionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDbVersionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionData.cs new file mode 100644 index 000000000000..0df166ccc4fc --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the AutonomousDbVersion data model. + /// AutonomousDbVersion resource definition + /// + public partial class AutonomousDbVersionData : 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 AutonomousDbVersionData() + { + } + + /// 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 AutonomousDbVersionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AutonomousDbVersionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public AutonomousDbVersionProperties Properties { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionResource.Serialization.cs new file mode 100644 index 000000000000..d57149c48864 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionResource.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.OracleDatabase +{ + public partial class AutonomousDbVersionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AutonomousDbVersionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AutonomousDbVersionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionResource.cs new file mode 100644 index 000000000000..b8242333de80 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/AutonomousDbVersionResource.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; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing an AutonomousDbVersion along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAutonomousDbVersionResource method. + /// Otherwise you can get one from its parent resource using the GetAutonomousDbVersion method. + /// + public partial class AutonomousDbVersionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The location. + /// The autonomousdbversionsname. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string autonomousdbversionsname) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _autonomousDbVersionAutonomousDatabaseVersionsClientDiagnostics; + private readonly AutonomousDatabaseVersionsRestOperations _autonomousDbVersionAutonomousDatabaseVersionsRestClient; + private readonly AutonomousDbVersionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/locations/autonomousDbVersions"; + + /// Initializes a new instance of the class for mocking. + protected AutonomousDbVersionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AutonomousDbVersionResource(ArmClient client, AutonomousDbVersionData 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 AutonomousDbVersionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _autonomousDbVersionAutonomousDatabaseVersionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string autonomousDbVersionAutonomousDatabaseVersionsApiVersion); + _autonomousDbVersionAutonomousDatabaseVersionsRestClient = new AutonomousDatabaseVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autonomousDbVersionAutonomousDatabaseVersionsApiVersion); +#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 AutonomousDbVersionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a AutonomousDbVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname} + /// + /// + /// Operation Id + /// AutonomousDbVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _autonomousDbVersionAutonomousDatabaseVersionsClientDiagnostics.CreateScope("AutonomousDbVersionResource.Get"); + scope.Start(); + try + { + var response = await _autonomousDbVersionAutonomousDatabaseVersionsRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDbVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutonomousDbVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname} + /// + /// + /// Operation Id + /// AutonomousDbVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _autonomousDbVersionAutonomousDatabaseVersionsClientDiagnostics.CreateScope("AutonomousDbVersionResource.Get"); + scope.Start(); + try + { + var response = _autonomousDbVersionAutonomousDatabaseVersionsRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutonomousDbVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureCollection.cs new file mode 100644 index 000000000000..a03c22781484 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureCollection.cs @@ -0,0 +1,494 @@ +// 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.OracleDatabase +{ + /// + /// 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 GetCloudExadataInfrastructures method from an instance of . + /// + public partial class CloudExadataInfrastructureCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _cloudExadataInfrastructureClientDiagnostics; + private readonly CloudExadataInfrastructuresRestOperations _cloudExadataInfrastructureRestClient; + + /// Initializes a new instance of the class for mocking. + protected CloudExadataInfrastructureCollection() + { + } + + /// 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 CloudExadataInfrastructureCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _cloudExadataInfrastructureClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", CloudExadataInfrastructureResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(CloudExadataInfrastructureResource.ResourceType, out string cloudExadataInfrastructureApiVersion); + _cloudExadataInfrastructureRestClient = new CloudExadataInfrastructuresRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cloudExadataInfrastructureApiVersion); +#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)); + } + + /// + /// Create a CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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. + /// CloudExadataInfrastructure name. + /// Resource create parameters. + /// 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 cloudexadatainfrastructurename, CloudExadataInfrastructureData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _cloudExadataInfrastructureRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, cloudexadatainfrastructurename, data, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new CloudExadataInfrastructureOperationSource(Client), _cloudExadataInfrastructureClientDiagnostics, Pipeline, _cloudExadataInfrastructureRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, cloudexadatainfrastructurename, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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. + /// CloudExadataInfrastructure name. + /// Resource create parameters. + /// 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 cloudexadatainfrastructurename, CloudExadataInfrastructureData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _cloudExadataInfrastructureRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, cloudexadatainfrastructurename, data, cancellationToken); + var operation = new OracleDatabaseArmOperation(new CloudExadataInfrastructureOperationSource(Client), _cloudExadataInfrastructureClientDiagnostics, Pipeline, _cloudExadataInfrastructureRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, cloudexadatainfrastructurename, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudExadataInfrastructure 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 cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var scope = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureCollection.Get"); + scope.Start(); + try + { + var response = await _cloudExadataInfrastructureRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, cloudexadatainfrastructurename, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CloudExadataInfrastructureResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudExadataInfrastructure name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var scope = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureCollection.Get"); + scope.Start(); + try + { + var response = _cloudExadataInfrastructureRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, cloudexadatainfrastructurename, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CloudExadataInfrastructureResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List CloudExadataInfrastructure resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-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) => _cloudExadataInfrastructureRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudExadataInfrastructureRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CloudExadataInfrastructureResource(Client, CloudExadataInfrastructureData.DeserializeCloudExadataInfrastructureData(e)), _cloudExadataInfrastructureClientDiagnostics, Pipeline, "CloudExadataInfrastructureCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List CloudExadataInfrastructure resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-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) => _cloudExadataInfrastructureRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudExadataInfrastructureRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CloudExadataInfrastructureResource(Client, CloudExadataInfrastructureData.DeserializeCloudExadataInfrastructureData(e)), _cloudExadataInfrastructureClientDiagnostics, Pipeline, "CloudExadataInfrastructureCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudExadataInfrastructure 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 cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var scope = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureCollection.Exists"); + scope.Start(); + try + { + var response = await _cloudExadataInfrastructureRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, cloudexadatainfrastructurename, 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/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudExadataInfrastructure name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var scope = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureCollection.Exists"); + scope.Start(); + try + { + var response = _cloudExadataInfrastructureRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, cloudexadatainfrastructurename, 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/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudExadataInfrastructure 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 cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var scope = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _cloudExadataInfrastructureRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, cloudexadatainfrastructurename, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new CloudExadataInfrastructureResource(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/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudExadataInfrastructure name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var scope = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureCollection.GetIfExists"); + scope.Start(); + try + { + var response = _cloudExadataInfrastructureRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, cloudexadatainfrastructurename, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new CloudExadataInfrastructureResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureData.Serialization.cs new file mode 100644 index 000000000000..75ea13884e0f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureData.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; +using Azure.ResourceManager.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class CloudExadataInfrastructureData : 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(CloudExadataInfrastructureData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + writer.WritePropertyName("zones"u8); + writer.WriteStartArray(); + foreach (var item in Zones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + + CloudExadataInfrastructureData 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(CloudExadataInfrastructureData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudExadataInfrastructureData(document.RootElement, options); + } + + internal static CloudExadataInfrastructureData DeserializeCloudExadataInfrastructureData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CloudExadataInfrastructureProperties properties = default; + IList zones = 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 = CloudExadataInfrastructureProperties.DeserializeCloudExadataInfrastructureProperties(property.Value, options); + continue; + } + if (property.NameEquals("zones"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; + 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 CloudExadataInfrastructureData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + zones, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CloudExadataInfrastructureData)} does not support writing '{options.Format}' format."); + } + } + + CloudExadataInfrastructureData 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 DeserializeCloudExadataInfrastructureData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CloudExadataInfrastructureData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureData.cs new file mode 100644 index 000000000000..3e1a25cef6b5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureData.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; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the CloudExadataInfrastructure data model. + /// CloudExadataInfrastructure resource definition + /// + public partial class CloudExadataInfrastructureData : 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. + /// CloudExadataInfrastructure zones. + /// is null. + public CloudExadataInfrastructureData(AzureLocation location, IEnumerable zones) : base(location) + { + Argument.AssertNotNull(zones, nameof(zones)); + + Zones = zones.ToList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// CloudExadataInfrastructure zones. + /// Keeps track of any properties unknown to the library. + internal CloudExadataInfrastructureData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CloudExadataInfrastructureProperties properties, IList zones, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Zones = zones; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CloudExadataInfrastructureData() + { + } + + /// The resource-specific properties for this resource. + public CloudExadataInfrastructureProperties Properties { get; set; } + /// CloudExadataInfrastructure zones. + public IList Zones { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureResource.Serialization.cs new file mode 100644 index 000000000000..d4584fbea82c --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureResource.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.OracleDatabase +{ + public partial class CloudExadataInfrastructureResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + CloudExadataInfrastructureData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + CloudExadataInfrastructureData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureResource.cs new file mode 100644 index 000000000000..fa5581c28f9c --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudExadataInfrastructureResource.cs @@ -0,0 +1,860 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing a CloudExadataInfrastructure 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 GetCloudExadataInfrastructureResource method. + /// Otherwise you can get one from its parent resource using the GetCloudExadataInfrastructure method. + /// + public partial class CloudExadataInfrastructureResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The cloudexadatainfrastructurename. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _cloudExadataInfrastructureClientDiagnostics; + private readonly CloudExadataInfrastructuresRestOperations _cloudExadataInfrastructureRestClient; + private readonly CloudExadataInfrastructureData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/cloudExadataInfrastructures"; + + /// Initializes a new instance of the class for mocking. + protected CloudExadataInfrastructureResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal CloudExadataInfrastructureResource(ArmClient client, CloudExadataInfrastructureData 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 CloudExadataInfrastructureResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _cloudExadataInfrastructureClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string cloudExadataInfrastructureApiVersion); + _cloudExadataInfrastructureRestClient = new CloudExadataInfrastructuresRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cloudExadataInfrastructureApiVersion); +#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 CloudExadataInfrastructureData 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 DbServerResources in the CloudExadataInfrastructure. + /// An object representing collection of DbServerResources and their operations over a DbServerResource. + public virtual DbServerCollection GetDbServers() + { + return GetCachedClient(client => new DbServerCollection(client, Id)); + } + + /// + /// Get a DbServer + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid} + /// + /// + /// Operation Id + /// DbServer_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbServer OCID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDbServerAsync(string dbserverocid, CancellationToken cancellationToken = default) + { + return await GetDbServers().GetAsync(dbserverocid, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DbServer + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid} + /// + /// + /// Operation Id + /// DbServer_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbServer OCID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDbServer(string dbserverocid, CancellationToken cancellationToken = default) + { + return GetDbServers().Get(dbserverocid, cancellationToken); + } + + /// + /// Get a CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureResource.Get"); + scope.Start(); + try + { + var response = await _cloudExadataInfrastructureRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CloudExadataInfrastructureResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureResource.Get"); + scope.Start(); + try + { + var response = _cloudExadataInfrastructureRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CloudExadataInfrastructureResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureResource.Delete"); + scope.Start(); + try + { + var response = await _cloudExadataInfrastructureRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_cloudExadataInfrastructureClientDiagnostics, Pipeline, _cloudExadataInfrastructureRestClient.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; + } + } + + /// + /// Delete a CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureResource.Delete"); + scope.Start(); + try + { + var response = _cloudExadataInfrastructureRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new OracleDatabaseArmOperation(_cloudExadataInfrastructureClientDiagnostics, Pipeline, _cloudExadataInfrastructureRestClient.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; + } + } + + /// + /// Update a CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CloudExadataInfrastructurePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureResource.Update"); + scope.Start(); + try + { + var response = await _cloudExadataInfrastructureRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new CloudExadataInfrastructureOperationSource(Client), _cloudExadataInfrastructureClientDiagnostics, Pipeline, _cloudExadataInfrastructureRestClient.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; + } + } + + /// + /// Update a CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, CloudExadataInfrastructurePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureResource.Update"); + scope.Start(); + try + { + var response = _cloudExadataInfrastructureRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new OracleDatabaseArmOperation(new CloudExadataInfrastructureOperationSource(Client), _cloudExadataInfrastructureClientDiagnostics, Pipeline, _cloudExadataInfrastructureRestClient.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; + } + } + + /// + /// Perform add storage capacity on exadata infra + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/addStorageCapacity + /// + /// + /// Operation Id + /// CloudExadataInfrastructures_AddStorageCapacity + /// + /// + /// Default Api Version + /// 2025-03-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> AddStorageCapacityAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureResource.AddStorageCapacity"); + scope.Start(); + try + { + var response = await _cloudExadataInfrastructureRestClient.AddStorageCapacityAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new CloudExadataInfrastructureOperationSource(Client), _cloudExadataInfrastructureClientDiagnostics, Pipeline, _cloudExadataInfrastructureRestClient.CreateAddStorageCapacityRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Perform add storage capacity on exadata infra + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/addStorageCapacity + /// + /// + /// Operation Id + /// CloudExadataInfrastructures_AddStorageCapacity + /// + /// + /// Default Api Version + /// 2025-03-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 AddStorageCapacity(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureResource.AddStorageCapacity"); + scope.Start(); + try + { + var response = _cloudExadataInfrastructureRestClient.AddStorageCapacity(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new OracleDatabaseArmOperation(new CloudExadataInfrastructureOperationSource(Client), _cloudExadataInfrastructureClientDiagnostics, Pipeline, _cloudExadataInfrastructureRestClient.CreateAddStorageCapacityRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureResource.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 _cloudExadataInfrastructureRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new CloudExadataInfrastructureResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new CloudExadataInfrastructurePatch(); + 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/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureResource.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 = _cloudExadataInfrastructureRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new CloudExadataInfrastructureResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new CloudExadataInfrastructurePatch(); + 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/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureResource.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 _cloudExadataInfrastructureRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new CloudExadataInfrastructureResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new CloudExadataInfrastructurePatch(); + 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/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureResource.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 = _cloudExadataInfrastructureRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new CloudExadataInfrastructureResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new CloudExadataInfrastructurePatch(); + 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/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureResource.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 _cloudExadataInfrastructureRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new CloudExadataInfrastructureResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new CloudExadataInfrastructurePatch(); + 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/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudExadataInfrastructureClientDiagnostics.CreateScope("CloudExadataInfrastructureResource.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 = _cloudExadataInfrastructureRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new CloudExadataInfrastructureResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new CloudExadataInfrastructurePatch(); + 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterCollection.cs new file mode 100644 index 000000000000..61c30483e41b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterCollection.cs @@ -0,0 +1,494 @@ +// 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.OracleDatabase +{ + /// + /// 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 GetCloudVmClusters method from an instance of . + /// + public partial class CloudVmClusterCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _cloudVmClusterClientDiagnostics; + private readonly CloudVmClustersRestOperations _cloudVmClusterRestClient; + + /// Initializes a new instance of the class for mocking. + protected CloudVmClusterCollection() + { + } + + /// 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 CloudVmClusterCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _cloudVmClusterClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", CloudVmClusterResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(CloudVmClusterResource.ResourceType, out string cloudVmClusterApiVersion); + _cloudVmClusterRestClient = new CloudVmClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cloudVmClusterApiVersion); +#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)); + } + + /// + /// Create a CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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. + /// CloudVmCluster name. + /// Resource create parameters. + /// 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 cloudvmclustername, CloudVmClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _cloudVmClusterRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, cloudvmclustername, data, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new CloudVmClusterOperationSource(Client), _cloudVmClusterClientDiagnostics, Pipeline, _cloudVmClusterRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, cloudvmclustername, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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. + /// CloudVmCluster name. + /// Resource create parameters. + /// 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 cloudvmclustername, CloudVmClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _cloudVmClusterRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, cloudvmclustername, data, cancellationToken); + var operation = new OracleDatabaseArmOperation(new CloudVmClusterOperationSource(Client), _cloudVmClusterClientDiagnostics, Pipeline, _cloudVmClusterRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, cloudvmclustername, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudVmCluster 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 cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterCollection.Get"); + scope.Start(); + try + { + var response = await _cloudVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, cloudvmclustername, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CloudVmClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudVmCluster name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterCollection.Get"); + scope.Start(); + try + { + var response = _cloudVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, cloudvmclustername, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CloudVmClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List CloudVmCluster resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters + /// + /// + /// Operation Id + /// CloudVmCluster_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-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) => _cloudVmClusterRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudVmClusterRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CloudVmClusterResource(Client, CloudVmClusterData.DeserializeCloudVmClusterData(e)), _cloudVmClusterClientDiagnostics, Pipeline, "CloudVmClusterCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List CloudVmCluster resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters + /// + /// + /// Operation Id + /// CloudVmCluster_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-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) => _cloudVmClusterRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudVmClusterRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CloudVmClusterResource(Client, CloudVmClusterData.DeserializeCloudVmClusterData(e)), _cloudVmClusterClientDiagnostics, Pipeline, "CloudVmClusterCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudVmCluster 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 cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterCollection.Exists"); + scope.Start(); + try + { + var response = await _cloudVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, cloudvmclustername, 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/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudVmCluster name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterCollection.Exists"); + scope.Start(); + try + { + var response = _cloudVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, cloudvmclustername, 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/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudVmCluster 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 cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _cloudVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, cloudvmclustername, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new CloudVmClusterResource(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/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudVmCluster name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterCollection.GetIfExists"); + scope.Start(); + try + { + var response = _cloudVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, cloudvmclustername, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new CloudVmClusterResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterData.Serialization.cs new file mode 100644 index 000000000000..f8a8ff693860 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class CloudVmClusterData : 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(CloudVmClusterData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + CloudVmClusterData 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(CloudVmClusterData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudVmClusterData(document.RootElement, options); + } + + internal static CloudVmClusterData DeserializeCloudVmClusterData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CloudVmClusterProperties 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 = CloudVmClusterProperties.DeserializeCloudVmClusterProperties(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 CloudVmClusterData( + 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); + default: + throw new FormatException($"The model {nameof(CloudVmClusterData)} does not support writing '{options.Format}' format."); + } + } + + CloudVmClusterData 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 DeserializeCloudVmClusterData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CloudVmClusterData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterData.cs new file mode 100644 index 000000000000..c5b7897bcb34 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the CloudVmCluster data model. + /// CloudVmCluster resource definition + /// + public partial class CloudVmClusterData : 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 CloudVmClusterData(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 CloudVmClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CloudVmClusterProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CloudVmClusterData() + { + } + + /// The resource-specific properties for this resource. + public CloudVmClusterProperties Properties { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterResource.Serialization.cs new file mode 100644 index 000000000000..ef62da1df66f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterResource.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.OracleDatabase +{ + public partial class CloudVmClusterResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + CloudVmClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + CloudVmClusterData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterResource.cs new file mode 100644 index 000000000000..57c5bbe41347 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/CloudVmClusterResource.cs @@ -0,0 +1,1096 @@ +// 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 Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.OracleDatabase.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing a CloudVmCluster 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 GetCloudVmClusterResource method. + /// Otherwise you can get one from its parent resource using the GetCloudVmCluster method. + /// + public partial class CloudVmClusterResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The cloudvmclustername. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string cloudvmclustername) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _cloudVmClusterClientDiagnostics; + private readonly CloudVmClustersRestOperations _cloudVmClusterRestClient; + private readonly CloudVmClusterData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/cloudVmClusters"; + + /// Initializes a new instance of the class for mocking. + protected CloudVmClusterResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal CloudVmClusterResource(ArmClient client, CloudVmClusterData 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 CloudVmClusterResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _cloudVmClusterClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string cloudVmClusterApiVersion); + _cloudVmClusterRestClient = new CloudVmClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cloudVmClusterApiVersion); +#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 CloudVmClusterData 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 VirtualNetworkAddressResources in the CloudVmCluster. + /// An object representing collection of VirtualNetworkAddressResources and their operations over a VirtualNetworkAddressResource. + public virtual VirtualNetworkAddressCollection GetVirtualNetworkAddresses() + { + return GetCachedClient(client => new VirtualNetworkAddressCollection(client, Id)); + } + + /// + /// Get a VirtualNetworkAddress + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Virtual IP address hostname. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetVirtualNetworkAddressAsync(string virtualnetworkaddressname, CancellationToken cancellationToken = default) + { + return await GetVirtualNetworkAddresses().GetAsync(virtualnetworkaddressname, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a VirtualNetworkAddress + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Virtual IP address hostname. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetVirtualNetworkAddress(string virtualnetworkaddressname, CancellationToken cancellationToken = default) + { + return GetVirtualNetworkAddresses().Get(virtualnetworkaddressname, cancellationToken); + } + + /// Gets a collection of DbNodeResources in the CloudVmCluster. + /// An object representing collection of DbNodeResources and their operations over a DbNodeResource. + public virtual DbNodeCollection GetDbNodes() + { + return GetCachedClient(client => new DbNodeCollection(client, Id)); + } + + /// + /// Get a DbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid} + /// + /// + /// Operation Id + /// DbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbNode OCID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDbNodeAsync(string dbnodeocid, CancellationToken cancellationToken = default) + { + return await GetDbNodes().GetAsync(dbnodeocid, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid} + /// + /// + /// Operation Id + /// DbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbNode OCID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDbNode(string dbnodeocid, CancellationToken cancellationToken = default) + { + return GetDbNodes().Get(dbnodeocid, cancellationToken); + } + + /// + /// Get a CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.Get"); + scope.Start(); + try + { + var response = await _cloudVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CloudVmClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.Get"); + scope.Start(); + try + { + var response = _cloudVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CloudVmClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.Delete"); + scope.Start(); + try + { + var response = await _cloudVmClusterRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_cloudVmClusterClientDiagnostics, Pipeline, _cloudVmClusterRestClient.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; + } + } + + /// + /// Delete a CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.Delete"); + scope.Start(); + try + { + var response = _cloudVmClusterRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new OracleDatabaseArmOperation(_cloudVmClusterClientDiagnostics, Pipeline, _cloudVmClusterRestClient.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; + } + } + + /// + /// Update a CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CloudVmClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.Update"); + scope.Start(); + try + { + var response = await _cloudVmClusterRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new CloudVmClusterOperationSource(Client), _cloudVmClusterClientDiagnostics, Pipeline, _cloudVmClusterRestClient.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; + } + } + + /// + /// Update a CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, CloudVmClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.Update"); + scope.Start(); + try + { + var response = _cloudVmClusterRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new OracleDatabaseArmOperation(new CloudVmClusterOperationSource(Client), _cloudVmClusterClientDiagnostics, Pipeline, _cloudVmClusterRestClient.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 VMs to the VM Cluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/addVms + /// + /// + /// Operation Id + /// CloudVmClusters_AddVms + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> AddVmsAsync(WaitUntil waitUntil, AddRemoveDbNode body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.AddVms"); + scope.Start(); + try + { + var response = await _cloudVmClusterRestClient.AddVmsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new CloudVmClusterOperationSource(Client), _cloudVmClusterClientDiagnostics, Pipeline, _cloudVmClusterRestClient.CreateAddVmsRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Add VMs to the VM Cluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/addVms + /// + /// + /// Operation Id + /// CloudVmClusters_AddVms + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation AddVms(WaitUntil waitUntil, AddRemoveDbNode body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.AddVms"); + scope.Start(); + try + { + var response = _cloudVmClusterRestClient.AddVms(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken); + var operation = new OracleDatabaseArmOperation(new CloudVmClusterOperationSource(Client), _cloudVmClusterClientDiagnostics, Pipeline, _cloudVmClusterRestClient.CreateAddVmsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Remove VMs from the VM Cluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/removeVms + /// + /// + /// Operation Id + /// CloudVmClusters_RemoveVms + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveVmsAsync(WaitUntil waitUntil, AddRemoveDbNode body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.RemoveVms"); + scope.Start(); + try + { + var response = await _cloudVmClusterRestClient.RemoveVmsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new CloudVmClusterOperationSource(Client), _cloudVmClusterClientDiagnostics, Pipeline, _cloudVmClusterRestClient.CreateRemoveVmsRequest(Id.SubscriptionId, Id.ResourceGroupName, 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; + } + } + + /// + /// Remove VMs from the VM Cluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/removeVms + /// + /// + /// Operation Id + /// CloudVmClusters_RemoveVms + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation RemoveVms(WaitUntil waitUntil, AddRemoveDbNode body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.RemoveVms"); + scope.Start(); + try + { + var response = _cloudVmClusterRestClient.RemoveVms(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body, cancellationToken); + var operation = new OracleDatabaseArmOperation(new CloudVmClusterOperationSource(Client), _cloudVmClusterClientDiagnostics, Pipeline, _cloudVmClusterRestClient.CreateRemoveVmsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Private IP Addresses by the provided filter + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/listPrivateIpAddresses + /// + /// + /// Operation Id + /// CloudVmClusters_ListPrivateIPAddresses + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The content of the action request. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetPrivateIPAddressesAsync(PrivateIPAddressesFilter body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudVmClusterRestClient.CreateListPrivateIPAddressesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => PrivateIPAddressProperties.DeserializePrivateIPAddressProperties(e), _cloudVmClusterClientDiagnostics, Pipeline, "CloudVmClusterResource.GetPrivateIPAddresses", "", null, cancellationToken); + } + + /// + /// List Private IP Addresses by the provided filter + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/listPrivateIpAddresses + /// + /// + /// Operation Id + /// CloudVmClusters_ListPrivateIPAddresses + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The content of the action request. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetPrivateIPAddresses(PrivateIPAddressesFilter body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudVmClusterRestClient.CreateListPrivateIPAddressesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, body); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => PrivateIPAddressProperties.DeserializePrivateIPAddressProperties(e), _cloudVmClusterClientDiagnostics, Pipeline, "CloudVmClusterResource.GetPrivateIPAddresses", "", null, cancellationToken); + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.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 _cloudVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new CloudVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new CloudVmClusterPatch(); + 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/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.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 = _cloudVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new CloudVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new CloudVmClusterPatch(); + 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/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.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 _cloudVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new CloudVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new CloudVmClusterPatch(); + 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/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.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 = _cloudVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new CloudVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new CloudVmClusterPatch(); + 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/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.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 _cloudVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new CloudVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new CloudVmClusterPatch(); + 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/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _cloudVmClusterClientDiagnostics.CreateScope("CloudVmClusterResource.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 = _cloudVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new CloudVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new CloudVmClusterPatch(); + 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeCollection.cs new file mode 100644 index 000000000000..19f2a0d5d505 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeCollection.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.OracleDatabase +{ + /// + /// 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 GetDbNodes method from an instance of . + /// + public partial class DbNodeCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dbNodeClientDiagnostics; + private readonly DbNodesRestOperations _dbNodeRestClient; + + /// Initializes a new instance of the class for mocking. + protected DbNodeCollection() + { + } + + /// 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 DbNodeCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dbNodeClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", DbNodeResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DbNodeResource.ResourceType, out string dbNodeApiVersion); + _dbNodeRestClient = new DbNodesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dbNodeApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CloudVmClusterResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CloudVmClusterResource.ResourceType), nameof(id)); + } + + /// + /// Get a DbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid} + /// + /// + /// Operation Id + /// DbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbNode OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string dbnodeocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbnodeocid, nameof(dbnodeocid)); + + using var scope = _dbNodeClientDiagnostics.CreateScope("DbNodeCollection.Get"); + scope.Start(); + try + { + var response = await _dbNodeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dbnodeocid, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DbNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid} + /// + /// + /// Operation Id + /// DbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbNode OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string dbnodeocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbnodeocid, nameof(dbnodeocid)); + + using var scope = _dbNodeClientDiagnostics.CreateScope("DbNodeCollection.Get"); + scope.Start(); + try + { + var response = _dbNodeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dbnodeocid, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DbNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List DbNode resources by CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes + /// + /// + /// Operation Id + /// DbNode_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-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) => _dbNodeRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dbNodeRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DbNodeResource(Client, DbNodeData.DeserializeDbNodeData(e)), _dbNodeClientDiagnostics, Pipeline, "DbNodeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List DbNode resources by CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes + /// + /// + /// Operation Id + /// DbNode_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-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) => _dbNodeRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dbNodeRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DbNodeResource(Client, DbNodeData.DeserializeDbNodeData(e)), _dbNodeClientDiagnostics, Pipeline, "DbNodeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid} + /// + /// + /// Operation Id + /// DbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbNode OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string dbnodeocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbnodeocid, nameof(dbnodeocid)); + + using var scope = _dbNodeClientDiagnostics.CreateScope("DbNodeCollection.Exists"); + scope.Start(); + try + { + var response = await _dbNodeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dbnodeocid, 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/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid} + /// + /// + /// Operation Id + /// DbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbNode OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string dbnodeocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbnodeocid, nameof(dbnodeocid)); + + using var scope = _dbNodeClientDiagnostics.CreateScope("DbNodeCollection.Exists"); + scope.Start(); + try + { + var response = _dbNodeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dbnodeocid, 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/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid} + /// + /// + /// Operation Id + /// DbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbNode OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string dbnodeocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbnodeocid, nameof(dbnodeocid)); + + using var scope = _dbNodeClientDiagnostics.CreateScope("DbNodeCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dbNodeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dbnodeocid, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DbNodeResource(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/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid} + /// + /// + /// Operation Id + /// DbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbNode OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string dbnodeocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbnodeocid, nameof(dbnodeocid)); + + using var scope = _dbNodeClientDiagnostics.CreateScope("DbNodeCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dbNodeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dbnodeocid, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DbNodeResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeData.Serialization.cs new file mode 100644 index 000000000000..9113f44bd4e9 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class DbNodeData : 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(DbNodeData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DbNodeData 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(DbNodeData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDbNodeData(document.RootElement, options); + } + + internal static DbNodeData DeserializeDbNodeData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DbNodeProperties 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 = DbNodeProperties.DeserializeDbNodeProperties(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 DbNodeData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DbNodeData)} does not support writing '{options.Format}' format."); + } + } + + DbNodeData 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 DeserializeDbNodeData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DbNodeData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeData.cs new file mode 100644 index 000000000000..f554ff697df3 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the DbNode data model. + /// The DbNode resource belonging to vmCluster + /// + public partial class DbNodeData : 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 DbNodeData() + { + } + + /// 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 DbNodeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DbNodeProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DbNodeProperties Properties { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeResource.Serialization.cs new file mode 100644 index 000000000000..91f8cf427673 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeResource.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.OracleDatabase +{ + public partial class DbNodeResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DbNodeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DbNodeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeResource.cs new file mode 100644 index 000000000000..571efe901b1a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbNodeResource.cs @@ -0,0 +1,264 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing a DbNode 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 GetDbNodeResource method. + /// Otherwise you can get one from its parent resource using the GetDbNode method. + /// + public partial class DbNodeResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The cloudvmclustername. + /// The dbnodeocid. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string cloudvmclustername, string dbnodeocid) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dbNodeClientDiagnostics; + private readonly DbNodesRestOperations _dbNodeRestClient; + private readonly DbNodeData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/cloudVmClusters/dbNodes"; + + /// Initializes a new instance of the class for mocking. + protected DbNodeResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DbNodeResource(ArmClient client, DbNodeData 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 DbNodeResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dbNodeClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dbNodeApiVersion); + _dbNodeRestClient = new DbNodesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dbNodeApiVersion); +#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 DbNodeData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a DbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid} + /// + /// + /// Operation Id + /// DbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dbNodeClientDiagnostics.CreateScope("DbNodeResource.Get"); + scope.Start(); + try + { + var response = await _dbNodeRestClient.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 DbNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid} + /// + /// + /// Operation Id + /// DbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dbNodeClientDiagnostics.CreateScope("DbNodeResource.Get"); + scope.Start(); + try + { + var response = _dbNodeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DbNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// VM actions on DbNode of VM Cluster by the provided filter + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid}/action + /// + /// + /// Operation Id + /// DbNodes_Action + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> ActionAsync(WaitUntil waitUntil, DbNodeAction body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _dbNodeClientDiagnostics.CreateScope("DbNodeResource.Action"); + scope.Start(); + try + { + var response = await _dbNodeRestClient.ActionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new DbNodeOperationSource(Client), _dbNodeClientDiagnostics, Pipeline, _dbNodeRestClient.CreateActionRequest(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; + } + } + + /// + /// VM actions on DbNode of VM Cluster by the provided filter + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/dbNodes/{dbnodeocid}/action + /// + /// + /// Operation Id + /// DbNodes_Action + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Action(WaitUntil waitUntil, DbNodeAction body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _dbNodeClientDiagnostics.CreateScope("DbNodeResource.Action"); + scope.Start(); + try + { + var response = _dbNodeRestClient.Action(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new OracleDatabaseArmOperation(new DbNodeOperationSource(Client), _dbNodeClientDiagnostics, Pipeline, _dbNodeRestClient.CreateActionRequest(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerCollection.cs new file mode 100644 index 000000000000..6ca62f4737e3 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerCollection.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.OracleDatabase +{ + /// + /// 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 GetDbServers method from an instance of . + /// + public partial class DbServerCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dbServerClientDiagnostics; + private readonly DbServersRestOperations _dbServerRestClient; + + /// Initializes a new instance of the class for mocking. + protected DbServerCollection() + { + } + + /// 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 DbServerCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dbServerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", DbServerResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DbServerResource.ResourceType, out string dbServerApiVersion); + _dbServerRestClient = new DbServersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dbServerApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CloudExadataInfrastructureResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CloudExadataInfrastructureResource.ResourceType), nameof(id)); + } + + /// + /// Get a DbServer + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid} + /// + /// + /// Operation Id + /// DbServer_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbServer OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string dbserverocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbserverocid, nameof(dbserverocid)); + + using var scope = _dbServerClientDiagnostics.CreateScope("DbServerCollection.Get"); + scope.Start(); + try + { + var response = await _dbServerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dbserverocid, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DbServerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DbServer + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid} + /// + /// + /// Operation Id + /// DbServer_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbServer OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string dbserverocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbserverocid, nameof(dbserverocid)); + + using var scope = _dbServerClientDiagnostics.CreateScope("DbServerCollection.Get"); + scope.Start(); + try + { + var response = _dbServerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dbserverocid, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DbServerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List DbServer resources by CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers + /// + /// + /// Operation Id + /// DbServer_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-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) => _dbServerRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dbServerRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DbServerResource(Client, DbServerData.DeserializeDbServerData(e)), _dbServerClientDiagnostics, Pipeline, "DbServerCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List DbServer resources by CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers + /// + /// + /// Operation Id + /// DbServer_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-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) => _dbServerRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dbServerRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DbServerResource(Client, DbServerData.DeserializeDbServerData(e)), _dbServerClientDiagnostics, Pipeline, "DbServerCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid} + /// + /// + /// Operation Id + /// DbServer_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbServer OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string dbserverocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbserverocid, nameof(dbserverocid)); + + using var scope = _dbServerClientDiagnostics.CreateScope("DbServerCollection.Exists"); + scope.Start(); + try + { + var response = await _dbServerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dbserverocid, 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/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid} + /// + /// + /// Operation Id + /// DbServer_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbServer OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string dbserverocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbserverocid, nameof(dbserverocid)); + + using var scope = _dbServerClientDiagnostics.CreateScope("DbServerCollection.Exists"); + scope.Start(); + try + { + var response = _dbServerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dbserverocid, 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/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid} + /// + /// + /// Operation Id + /// DbServer_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbServer OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string dbserverocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbserverocid, nameof(dbserverocid)); + + using var scope = _dbServerClientDiagnostics.CreateScope("DbServerCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dbServerRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dbserverocid, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DbServerResource(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/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid} + /// + /// + /// Operation Id + /// DbServer_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbServer OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string dbserverocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbserverocid, nameof(dbserverocid)); + + using var scope = _dbServerClientDiagnostics.CreateScope("DbServerCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dbServerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, dbserverocid, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DbServerResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerData.Serialization.cs new file mode 100644 index 000000000000..8305d2d57961 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class DbServerData : 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(DbServerData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DbServerData 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(DbServerData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDbServerData(document.RootElement, options); + } + + internal static DbServerData DeserializeDbServerData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DbServerProperties 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 = DbServerProperties.DeserializeDbServerProperties(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 DbServerData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DbServerData)} does not support writing '{options.Format}' format."); + } + } + + DbServerData 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 DeserializeDbServerData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DbServerData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerData.cs new file mode 100644 index 000000000000..fe015f457cb0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the DbServer data model. + /// DbServer resource model + /// + public partial class DbServerData : 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 DbServerData() + { + } + + /// 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 DbServerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DbServerProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DbServerProperties Properties { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerResource.Serialization.cs new file mode 100644 index 000000000000..283a415afbd2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerResource.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.OracleDatabase +{ + public partial class DbServerResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DbServerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DbServerData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerResource.cs new file mode 100644 index 000000000000..4aac01ebf5b0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbServerResource.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.OracleDatabase +{ + /// + /// A Class representing a DbServer 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 GetDbServerResource method. + /// Otherwise you can get one from its parent resource using the GetDbServer method. + /// + public partial class DbServerResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The cloudexadatainfrastructurename. + /// The dbserverocid. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, string dbserverocid) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dbServerClientDiagnostics; + private readonly DbServersRestOperations _dbServerRestClient; + private readonly DbServerData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/cloudExadataInfrastructures/dbServers"; + + /// Initializes a new instance of the class for mocking. + protected DbServerResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DbServerResource(ArmClient client, DbServerData 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 DbServerResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dbServerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dbServerApiVersion); + _dbServerRestClient = new DbServersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dbServerApiVersion); +#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 DbServerData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a DbServer + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid} + /// + /// + /// Operation Id + /// DbServer_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dbServerClientDiagnostics.CreateScope("DbServerResource.Get"); + scope.Start(); + try + { + var response = await _dbServerRestClient.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 DbServerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DbServer + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename}/dbServers/{dbserverocid} + /// + /// + /// Operation Id + /// DbServer_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dbServerClientDiagnostics.CreateScope("DbServerResource.Get"); + scope.Start(); + try + { + var response = _dbServerRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DbServerResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeCollection.cs new file mode 100644 index 000000000000..ba6f7acba62f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeCollection.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; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// 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 GetDbSystemShapes method from an instance of . + /// + public partial class DbSystemShapeCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dbSystemShapeClientDiagnostics; + private readonly DbSystemShapesRestOperations _dbSystemShapeRestClient; + private readonly AzureLocation _location; + + /// Initializes a new instance of the class for mocking. + protected DbSystemShapeCollection() + { + } + + /// 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. + /// The name of the Azure region. + internal DbSystemShapeCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) + { + _location = location; + _dbSystemShapeClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", DbSystemShapeResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DbSystemShapeResource.ResourceType, out string dbSystemShapeApiVersion); + _dbSystemShapeRestClient = new DbSystemShapesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dbSystemShapeApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Get a DbSystemShape + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename} + /// + /// + /// Operation Id + /// DbSystemShape_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbSystemShape 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 dbsystemshapename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbsystemshapename, nameof(dbsystemshapename)); + + using var scope = _dbSystemShapeClientDiagnostics.CreateScope("DbSystemShapeCollection.Get"); + scope.Start(); + try + { + var response = await _dbSystemShapeRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), dbsystemshapename, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DbSystemShapeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DbSystemShape + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename} + /// + /// + /// Operation Id + /// DbSystemShape_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbSystemShape name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string dbsystemshapename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbsystemshapename, nameof(dbsystemshapename)); + + using var scope = _dbSystemShapeClientDiagnostics.CreateScope("DbSystemShapeCollection.Get"); + scope.Start(); + try + { + var response = _dbSystemShapeRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), dbsystemshapename, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DbSystemShapeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List DbSystemShape resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes + /// + /// + /// Operation Id + /// DbSystemShape_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string zone = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dbSystemShapeRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location), zone); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dbSystemShapeRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location), zone); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DbSystemShapeResource(Client, DbSystemShapeData.DeserializeDbSystemShapeData(e)), _dbSystemShapeClientDiagnostics, Pipeline, "DbSystemShapeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List DbSystemShape resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes + /// + /// + /// Operation Id + /// DbSystemShape_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string zone = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dbSystemShapeRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location), zone); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dbSystemShapeRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location), zone); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DbSystemShapeResource(Client, DbSystemShapeData.DeserializeDbSystemShapeData(e)), _dbSystemShapeClientDiagnostics, Pipeline, "DbSystemShapeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename} + /// + /// + /// Operation Id + /// DbSystemShape_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbSystemShape 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 dbsystemshapename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbsystemshapename, nameof(dbsystemshapename)); + + using var scope = _dbSystemShapeClientDiagnostics.CreateScope("DbSystemShapeCollection.Exists"); + scope.Start(); + try + { + var response = await _dbSystemShapeRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), dbsystemshapename, 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}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename} + /// + /// + /// Operation Id + /// DbSystemShape_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbSystemShape name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string dbsystemshapename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbsystemshapename, nameof(dbsystemshapename)); + + using var scope = _dbSystemShapeClientDiagnostics.CreateScope("DbSystemShapeCollection.Exists"); + scope.Start(); + try + { + var response = _dbSystemShapeRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), dbsystemshapename, 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}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename} + /// + /// + /// Operation Id + /// DbSystemShape_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbSystemShape 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 dbsystemshapename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbsystemshapename, nameof(dbsystemshapename)); + + using var scope = _dbSystemShapeClientDiagnostics.CreateScope("DbSystemShapeCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dbSystemShapeRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), dbsystemshapename, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DbSystemShapeResource(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}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename} + /// + /// + /// Operation Id + /// DbSystemShape_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DbSystemShape name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string dbsystemshapename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dbsystemshapename, nameof(dbsystemshapename)); + + using var scope = _dbSystemShapeClientDiagnostics.CreateScope("DbSystemShapeCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dbSystemShapeRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), dbsystemshapename, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DbSystemShapeResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeData.Serialization.cs new file mode 100644 index 000000000000..bfd090df7b02 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class DbSystemShapeData : 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(DbSystemShapeData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DbSystemShapeData 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(DbSystemShapeData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDbSystemShapeData(document.RootElement, options); + } + + internal static DbSystemShapeData DeserializeDbSystemShapeData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DbSystemShapeProperties 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 = DbSystemShapeProperties.DeserializeDbSystemShapeProperties(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 DbSystemShapeData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DbSystemShapeData)} does not support writing '{options.Format}' format."); + } + } + + DbSystemShapeData 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 DeserializeDbSystemShapeData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DbSystemShapeData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeData.cs new file mode 100644 index 000000000000..b17b327120ed --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the DbSystemShape data model. + /// DbSystemShape resource definition + /// + public partial class DbSystemShapeData : 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 DbSystemShapeData() + { + } + + /// 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 DbSystemShapeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DbSystemShapeProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DbSystemShapeProperties Properties { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeResource.Serialization.cs new file mode 100644 index 000000000000..43c5850c36c7 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeResource.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.OracleDatabase +{ + public partial class DbSystemShapeResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DbSystemShapeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DbSystemShapeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeResource.cs new file mode 100644 index 000000000000..5b6fa15b2afd --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DbSystemShapeResource.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; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing a DbSystemShape 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 GetDbSystemShapeResource method. + /// Otherwise you can get one from its parent resource using the GetDbSystemShape method. + /// + public partial class DbSystemShapeResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The location. + /// The dbsystemshapename. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string dbsystemshapename) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dbSystemShapeClientDiagnostics; + private readonly DbSystemShapesRestOperations _dbSystemShapeRestClient; + private readonly DbSystemShapeData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/locations/dbSystemShapes"; + + /// Initializes a new instance of the class for mocking. + protected DbSystemShapeResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DbSystemShapeResource(ArmClient client, DbSystemShapeData 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 DbSystemShapeResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dbSystemShapeClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dbSystemShapeApiVersion); + _dbSystemShapeRestClient = new DbSystemShapesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dbSystemShapeApiVersion); +#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 DbSystemShapeData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a DbSystemShape + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename} + /// + /// + /// Operation Id + /// DbSystemShape_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dbSystemShapeClientDiagnostics.CreateScope("DbSystemShapeResource.Get"); + scope.Start(); + try + { + var response = await _dbSystemShapeRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DbSystemShapeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DbSystemShape + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename} + /// + /// + /// Operation Id + /// DbSystemShape_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dbSystemShapeClientDiagnostics.CreateScope("DbSystemShapeResource.Get"); + scope.Start(); + try + { + var response = _dbSystemShapeRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DbSystemShapeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewCollection.cs new file mode 100644 index 000000000000..ea29005e101e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewCollection.cs @@ -0,0 +1,399 @@ +// 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.OracleDatabase +{ + /// + /// 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 GetDnsPrivateViews method from an instance of . + /// + public partial class DnsPrivateViewCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dnsPrivateViewClientDiagnostics; + private readonly DnsPrivateViewsRestOperations _dnsPrivateViewRestClient; + private readonly AzureLocation _location; + + /// Initializes a new instance of the class for mocking. + protected DnsPrivateViewCollection() + { + } + + /// 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. + /// The name of the Azure region. + internal DnsPrivateViewCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) + { + _location = location; + _dnsPrivateViewClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", DnsPrivateViewResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DnsPrivateViewResource.ResourceType, out string dnsPrivateViewApiVersion); + _dnsPrivateViewRestClient = new DnsPrivateViewsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dnsPrivateViewApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Get a DnsPrivateView + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid} + /// + /// + /// Operation Id + /// DnsPrivateView_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DnsPrivateView OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string dnsprivateviewocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsprivateviewocid, nameof(dnsprivateviewocid)); + + using var scope = _dnsPrivateViewClientDiagnostics.CreateScope("DnsPrivateViewCollection.Get"); + scope.Start(); + try + { + var response = await _dnsPrivateViewRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), dnsprivateviewocid, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsPrivateViewResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DnsPrivateView + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid} + /// + /// + /// Operation Id + /// DnsPrivateView_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DnsPrivateView OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string dnsprivateviewocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsprivateviewocid, nameof(dnsprivateviewocid)); + + using var scope = _dnsPrivateViewClientDiagnostics.CreateScope("DnsPrivateViewCollection.Get"); + scope.Start(); + try + { + var response = _dnsPrivateViewRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), dnsprivateviewocid, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsPrivateViewResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List DnsPrivateView resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews + /// + /// + /// Operation Id + /// DnsPrivateView_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-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) => _dnsPrivateViewRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsPrivateViewRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DnsPrivateViewResource(Client, DnsPrivateViewData.DeserializeDnsPrivateViewData(e)), _dnsPrivateViewClientDiagnostics, Pipeline, "DnsPrivateViewCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List DnsPrivateView resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews + /// + /// + /// Operation Id + /// DnsPrivateView_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-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) => _dnsPrivateViewRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsPrivateViewRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsPrivateViewResource(Client, DnsPrivateViewData.DeserializeDnsPrivateViewData(e)), _dnsPrivateViewClientDiagnostics, Pipeline, "DnsPrivateViewCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid} + /// + /// + /// Operation Id + /// DnsPrivateView_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DnsPrivateView OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string dnsprivateviewocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsprivateviewocid, nameof(dnsprivateviewocid)); + + using var scope = _dnsPrivateViewClientDiagnostics.CreateScope("DnsPrivateViewCollection.Exists"); + scope.Start(); + try + { + var response = await _dnsPrivateViewRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), dnsprivateviewocid, 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}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid} + /// + /// + /// Operation Id + /// DnsPrivateView_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DnsPrivateView OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string dnsprivateviewocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsprivateviewocid, nameof(dnsprivateviewocid)); + + using var scope = _dnsPrivateViewClientDiagnostics.CreateScope("DnsPrivateViewCollection.Exists"); + scope.Start(); + try + { + var response = _dnsPrivateViewRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), dnsprivateviewocid, 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}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid} + /// + /// + /// Operation Id + /// DnsPrivateView_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DnsPrivateView OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string dnsprivateviewocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsprivateviewocid, nameof(dnsprivateviewocid)); + + using var scope = _dnsPrivateViewClientDiagnostics.CreateScope("DnsPrivateViewCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dnsPrivateViewRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), dnsprivateviewocid, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DnsPrivateViewResource(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}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid} + /// + /// + /// Operation Id + /// DnsPrivateView_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DnsPrivateView OCID. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string dnsprivateviewocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsprivateviewocid, nameof(dnsprivateviewocid)); + + using var scope = _dnsPrivateViewClientDiagnostics.CreateScope("DnsPrivateViewCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dnsPrivateViewRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), dnsprivateviewocid, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DnsPrivateViewResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewData.Serialization.cs new file mode 100644 index 000000000000..0ccb220dc059 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class DnsPrivateViewData : 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(DnsPrivateViewData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DnsPrivateViewData 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(DnsPrivateViewData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsPrivateViewData(document.RootElement, options); + } + + internal static DnsPrivateViewData DeserializeDnsPrivateViewData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DnsPrivateViewProperties 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 = DnsPrivateViewProperties.DeserializeDnsPrivateViewProperties(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 DnsPrivateViewData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DnsPrivateViewData)} does not support writing '{options.Format}' format."); + } + } + + DnsPrivateViewData 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 DeserializeDnsPrivateViewData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsPrivateViewData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewData.cs new file mode 100644 index 000000000000..c82c45d3d234 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the DnsPrivateView data model. + /// DnsPrivateView resource definition + /// + public partial class DnsPrivateViewData : 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 DnsPrivateViewData() + { + } + + /// 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 DnsPrivateViewData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DnsPrivateViewProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DnsPrivateViewProperties Properties { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewResource.Serialization.cs new file mode 100644 index 000000000000..0f9205c512c0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewResource.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.OracleDatabase +{ + public partial class DnsPrivateViewResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DnsPrivateViewData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DnsPrivateViewData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewResource.cs new file mode 100644 index 000000000000..1f301f89078e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateViewResource.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; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing a DnsPrivateView 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 GetDnsPrivateViewResource method. + /// Otherwise you can get one from its parent resource using the GetDnsPrivateView method. + /// + public partial class DnsPrivateViewResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The location. + /// The dnsprivateviewocid. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string dnsprivateviewocid) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dnsPrivateViewClientDiagnostics; + private readonly DnsPrivateViewsRestOperations _dnsPrivateViewRestClient; + private readonly DnsPrivateViewData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/locations/dnsPrivateViews"; + + /// Initializes a new instance of the class for mocking. + protected DnsPrivateViewResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DnsPrivateViewResource(ArmClient client, DnsPrivateViewData 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 DnsPrivateViewResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dnsPrivateViewClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dnsPrivateViewApiVersion); + _dnsPrivateViewRestClient = new DnsPrivateViewsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dnsPrivateViewApiVersion); +#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 DnsPrivateViewData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a DnsPrivateView + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid} + /// + /// + /// Operation Id + /// DnsPrivateView_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dnsPrivateViewClientDiagnostics.CreateScope("DnsPrivateViewResource.Get"); + scope.Start(); + try + { + var response = await _dnsPrivateViewRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsPrivateViewResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DnsPrivateView + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid} + /// + /// + /// Operation Id + /// DnsPrivateView_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dnsPrivateViewClientDiagnostics.CreateScope("DnsPrivateViewResource.Get"); + scope.Start(); + try + { + var response = _dnsPrivateViewRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsPrivateViewResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneCollection.cs new file mode 100644 index 000000000000..71aa632ca62a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneCollection.cs @@ -0,0 +1,399 @@ +// 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.OracleDatabase +{ + /// + /// 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 GetDnsPrivateZones method from an instance of . + /// + public partial class DnsPrivateZoneCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dnsPrivateZoneClientDiagnostics; + private readonly DnsPrivateZonesRestOperations _dnsPrivateZoneRestClient; + private readonly AzureLocation _location; + + /// Initializes a new instance of the class for mocking. + protected DnsPrivateZoneCollection() + { + } + + /// 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. + /// The name of the Azure region. + internal DnsPrivateZoneCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) + { + _location = location; + _dnsPrivateZoneClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", DnsPrivateZoneResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DnsPrivateZoneResource.ResourceType, out string dnsPrivateZoneApiVersion); + _dnsPrivateZoneRestClient = new DnsPrivateZonesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dnsPrivateZoneApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Get a DnsPrivateZone + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename} + /// + /// + /// Operation Id + /// DnsPrivateZone_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DnsPrivateZone 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 dnsprivatezonename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsprivatezonename, nameof(dnsprivatezonename)); + + using var scope = _dnsPrivateZoneClientDiagnostics.CreateScope("DnsPrivateZoneCollection.Get"); + scope.Start(); + try + { + var response = await _dnsPrivateZoneRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), dnsprivatezonename, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsPrivateZoneResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DnsPrivateZone + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename} + /// + /// + /// Operation Id + /// DnsPrivateZone_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DnsPrivateZone name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string dnsprivatezonename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsprivatezonename, nameof(dnsprivatezonename)); + + using var scope = _dnsPrivateZoneClientDiagnostics.CreateScope("DnsPrivateZoneCollection.Get"); + scope.Start(); + try + { + var response = _dnsPrivateZoneRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), dnsprivatezonename, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsPrivateZoneResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List DnsPrivateZone resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones + /// + /// + /// Operation Id + /// DnsPrivateZone_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-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) => _dnsPrivateZoneRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsPrivateZoneRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DnsPrivateZoneResource(Client, DnsPrivateZoneData.DeserializeDnsPrivateZoneData(e)), _dnsPrivateZoneClientDiagnostics, Pipeline, "DnsPrivateZoneCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List DnsPrivateZone resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones + /// + /// + /// Operation Id + /// DnsPrivateZone_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-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) => _dnsPrivateZoneRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dnsPrivateZoneRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DnsPrivateZoneResource(Client, DnsPrivateZoneData.DeserializeDnsPrivateZoneData(e)), _dnsPrivateZoneClientDiagnostics, Pipeline, "DnsPrivateZoneCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename} + /// + /// + /// Operation Id + /// DnsPrivateZone_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DnsPrivateZone 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 dnsprivatezonename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsprivatezonename, nameof(dnsprivatezonename)); + + using var scope = _dnsPrivateZoneClientDiagnostics.CreateScope("DnsPrivateZoneCollection.Exists"); + scope.Start(); + try + { + var response = await _dnsPrivateZoneRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), dnsprivatezonename, 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}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename} + /// + /// + /// Operation Id + /// DnsPrivateZone_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DnsPrivateZone name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string dnsprivatezonename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsprivatezonename, nameof(dnsprivatezonename)); + + using var scope = _dnsPrivateZoneClientDiagnostics.CreateScope("DnsPrivateZoneCollection.Exists"); + scope.Start(); + try + { + var response = _dnsPrivateZoneRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), dnsprivatezonename, 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}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename} + /// + /// + /// Operation Id + /// DnsPrivateZone_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DnsPrivateZone 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 dnsprivatezonename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsprivatezonename, nameof(dnsprivatezonename)); + + using var scope = _dnsPrivateZoneClientDiagnostics.CreateScope("DnsPrivateZoneCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dnsPrivateZoneRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), dnsprivatezonename, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DnsPrivateZoneResource(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}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename} + /// + /// + /// Operation Id + /// DnsPrivateZone_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// DnsPrivateZone name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string dnsprivatezonename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(dnsprivatezonename, nameof(dnsprivatezonename)); + + using var scope = _dnsPrivateZoneClientDiagnostics.CreateScope("DnsPrivateZoneCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dnsPrivateZoneRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), dnsprivatezonename, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DnsPrivateZoneResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneData.Serialization.cs new file mode 100644 index 000000000000..c31921097a40 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class DnsPrivateZoneData : 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(DnsPrivateZoneData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DnsPrivateZoneData 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(DnsPrivateZoneData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsPrivateZoneData(document.RootElement, options); + } + + internal static DnsPrivateZoneData DeserializeDnsPrivateZoneData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DnsPrivateZoneProperties 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 = DnsPrivateZoneProperties.DeserializeDnsPrivateZoneProperties(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 DnsPrivateZoneData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DnsPrivateZoneData)} does not support writing '{options.Format}' format."); + } + } + + DnsPrivateZoneData 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 DeserializeDnsPrivateZoneData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsPrivateZoneData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneData.cs new file mode 100644 index 000000000000..8292991838b2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the DnsPrivateZone data model. + /// DnsPrivateZone resource definition + /// + public partial class DnsPrivateZoneData : 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 DnsPrivateZoneData() + { + } + + /// 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 DnsPrivateZoneData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DnsPrivateZoneProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DnsPrivateZoneProperties Properties { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneResource.Serialization.cs new file mode 100644 index 000000000000..91441ab783cf --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneResource.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.OracleDatabase +{ + public partial class DnsPrivateZoneResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DnsPrivateZoneData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DnsPrivateZoneData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneResource.cs new file mode 100644 index 000000000000..0adb330234e2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/DnsPrivateZoneResource.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; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing a DnsPrivateZone 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 GetDnsPrivateZoneResource method. + /// Otherwise you can get one from its parent resource using the GetDnsPrivateZone method. + /// + public partial class DnsPrivateZoneResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The location. + /// The dnsprivatezonename. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string dnsprivatezonename) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dnsPrivateZoneClientDiagnostics; + private readonly DnsPrivateZonesRestOperations _dnsPrivateZoneRestClient; + private readonly DnsPrivateZoneData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/locations/dnsPrivateZones"; + + /// Initializes a new instance of the class for mocking. + protected DnsPrivateZoneResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DnsPrivateZoneResource(ArmClient client, DnsPrivateZoneData 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 DnsPrivateZoneResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dnsPrivateZoneClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dnsPrivateZoneApiVersion); + _dnsPrivateZoneRestClient = new DnsPrivateZonesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dnsPrivateZoneApiVersion); +#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 DnsPrivateZoneData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a DnsPrivateZone + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename} + /// + /// + /// Operation Id + /// DnsPrivateZone_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dnsPrivateZoneClientDiagnostics.CreateScope("DnsPrivateZoneResource.Get"); + scope.Start(); + try + { + var response = await _dnsPrivateZoneRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsPrivateZoneResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a DnsPrivateZone + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename} + /// + /// + /// Operation Id + /// DnsPrivateZone_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dnsPrivateZoneClientDiagnostics.CreateScope("DnsPrivateZoneResource.Get"); + scope.Start(); + try + { + var response = _dnsPrivateZoneRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DnsPrivateZoneResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterCollection.cs new file mode 100644 index 000000000000..41d8cec5b33e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterCollection.cs @@ -0,0 +1,494 @@ +// 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.OracleDatabase +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetExadbVmClusters method from an instance of . + /// + public partial class ExadbVmClusterCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _exadbVmClusterClientDiagnostics; + private readonly ExadbVmClustersRestOperations _exadbVmClusterRestClient; + + /// Initializes a new instance of the class for mocking. + protected ExadbVmClusterCollection() + { + } + + /// 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 ExadbVmClusterCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _exadbVmClusterClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ExadbVmClusterResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ExadbVmClusterResource.ResourceType, out string exadbVmClusterApiVersion); + _exadbVmClusterRestClient = new ExadbVmClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, exadbVmClusterApiVersion); +#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)); + } + + /// + /// Create a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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 name of the ExadbVmCluster. + /// Resource create parameters. + /// 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 exadbVmClusterName, ExadbVmClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, data, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new ExadbVmClusterOperationSource(Client), _exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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 name of the ExadbVmCluster. + /// Resource create parameters. + /// 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 exadbVmClusterName, ExadbVmClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, data, cancellationToken); + var operation = new OracleDatabaseArmOperation(new ExadbVmClusterOperationSource(Client), _exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.Get"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExadbVmClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.Get"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExadbVmClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List ExadbVmCluster resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters + /// + /// + /// Operation Id + /// ExadbVmCluster_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-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) => _exadbVmClusterRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exadbVmClusterRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExadbVmClusterResource(Client, ExadbVmClusterData.DeserializeExadbVmClusterData(e)), _exadbVmClusterClientDiagnostics, Pipeline, "ExadbVmClusterCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List ExadbVmCluster resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters + /// + /// + /// Operation Id + /// ExadbVmCluster_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-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) => _exadbVmClusterRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exadbVmClusterRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExadbVmClusterResource(Client, ExadbVmClusterData.DeserializeExadbVmClusterData(e)), _exadbVmClusterClientDiagnostics, Pipeline, "ExadbVmClusterCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.Exists"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.Exists"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ExadbVmClusterResource(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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterCollection.GetIfExists"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, exadbVmClusterName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ExadbVmClusterResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.Serialization.cs new file mode 100644 index 000000000000..e1ec90308459 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.Serialization.cs @@ -0,0 +1,204 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class ExadbVmClusterData : 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(ExadbVmClusterData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsCollectionDefined(Zones)) + { + writer.WritePropertyName("zones"u8); + writer.WriteStartArray(); + foreach (var item in Zones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + ExadbVmClusterData 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(ExadbVmClusterData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExadbVmClusterData(document.RootElement, options); + } + + internal static ExadbVmClusterData DeserializeExadbVmClusterData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExadbVmClusterProperties properties = default; + IList zones = 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 = ExadbVmClusterProperties.DeserializeExadbVmClusterProperties(property.Value, options); + continue; + } + if (property.NameEquals("zones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; + 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 ExadbVmClusterData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + zones ?? 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); + default: + throw new FormatException($"The model {nameof(ExadbVmClusterData)} does not support writing '{options.Format}' format."); + } + } + + ExadbVmClusterData 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 DeserializeExadbVmClusterData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExadbVmClusterData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.cs new file mode 100644 index 000000000000..7d9b7d350b23 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterData.cs @@ -0,0 +1,88 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the ExadbVmCluster data model. + /// ExadbVmCluster resource definition + /// + public partial class ExadbVmClusterData : 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 ExadbVmClusterData(AzureLocation location) : base(location) + { + Zones = new ChangeTrackingList(); + } + + /// 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 availability zones. + /// Keeps track of any properties unknown to the library. + internal ExadbVmClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExadbVmClusterProperties properties, IList zones, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Zones = zones; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExadbVmClusterData() + { + } + + /// The resource-specific properties for this resource. + public ExadbVmClusterProperties Properties { get; set; } + /// The availability zones. + public IList Zones { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.Serialization.cs new file mode 100644 index 000000000000..8de68a9361bc --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.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.OracleDatabase +{ + public partial class ExadbVmClusterResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ExadbVmClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ExadbVmClusterData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.cs new file mode 100644 index 000000000000..1a40f0ee947c --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExadbVmClusterResource.cs @@ -0,0 +1,868 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing an ExadbVmCluster along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetExadbVmClusterResource method. + /// Otherwise you can get one from its parent resource using the GetExadbVmCluster method. + /// + public partial class ExadbVmClusterResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The exadbVmClusterName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _exadbVmClusterClientDiagnostics; + private readonly ExadbVmClustersRestOperations _exadbVmClusterRestClient; + private readonly ExadbVmClusterData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/exadbVmClusters"; + + /// Initializes a new instance of the class for mocking. + protected ExadbVmClusterResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ExadbVmClusterResource(ArmClient client, ExadbVmClusterData 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 ExadbVmClusterResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _exadbVmClusterClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string exadbVmClusterApiVersion); + _exadbVmClusterRestClient = new ExadbVmClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, exadbVmClusterApiVersion); +#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 ExadbVmClusterData 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 ExascaleDbNodeResources in the ExadbVmCluster. + /// An object representing collection of ExascaleDbNodeResources and their operations over a ExascaleDbNodeResource. + public virtual ExascaleDbNodeCollection GetExascaleDbNodes() + { + return GetCachedClient(client => new ExascaleDbNodeCollection(client, Id)); + } + + /// + /// Get a ExascaleDbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetExascaleDbNodeAsync(string exascaleDbNodeName, CancellationToken cancellationToken = default) + { + return await GetExascaleDbNodes().GetAsync(exascaleDbNodeName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ExascaleDbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetExascaleDbNode(string exascaleDbNodeName, CancellationToken cancellationToken = default) + { + return GetExascaleDbNodes().Get(exascaleDbNodeName, cancellationToken); + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.Get"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExadbVmClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.Get"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExadbVmClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.Delete"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.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; + } + } + + /// + /// Delete a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.Delete"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new OracleDatabaseArmOperation(_exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.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; + } + } + + /// + /// Update a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ExadbVmClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.Update"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new ExadbVmClusterOperationSource(Client), _exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.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; + } + } + + /// + /// Update a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ExadbVmClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.Update"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new OracleDatabaseArmOperation(new ExadbVmClusterOperationSource(Client), _exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.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; + } + } + + /// + /// Remove VMs from the VM Cluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/removeVms + /// + /// + /// Operation Id + /// ExadbVmClusters_RemoveVms + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveVmsAsync(WaitUntil waitUntil, RemoveVirtualMachineFromExadbVmClusterDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.RemoveVms"); + scope.Start(); + try + { + var response = await _exadbVmClusterRestClient.RemoveVmsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new ExadbVmClusterOperationSource(Client), _exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.CreateRemoveVmsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Remove VMs from the VM Cluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/removeVms + /// + /// + /// Operation Id + /// ExadbVmClusters_RemoveVms + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation RemoveVms(WaitUntil waitUntil, RemoveVirtualMachineFromExadbVmClusterDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(details, nameof(details)); + + using var scope = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.RemoveVms"); + scope.Start(); + try + { + var response = _exadbVmClusterRestClient.RemoveVms(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details, cancellationToken); + var operation = new OracleDatabaseArmOperation(new ExadbVmClusterOperationSource(Client), _exadbVmClusterClientDiagnostics, Pipeline, _exadbVmClusterRestClient.CreateRemoveVmsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, details).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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.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 _exadbVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ExadbVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ExadbVmClusterPatch(); + 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.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 = _exadbVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ExadbVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ExadbVmClusterPatch(); + 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.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 _exadbVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ExadbVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ExadbVmClusterPatch(); + 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.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 = _exadbVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ExadbVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ExadbVmClusterPatch(); + 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.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 _exadbVmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ExadbVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ExadbVmClusterPatch(); + 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exadbVmClusterClientDiagnostics.CreateScope("ExadbVmClusterResource.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 = _exadbVmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ExadbVmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ExadbVmClusterPatch(); + 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeCollection.cs new file mode 100644 index 000000000000..65e11f60d08e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeCollection.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.OracleDatabase +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetExascaleDbNodes method from an instance of . + /// + public partial class ExascaleDbNodeCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _exascaleDbNodeClientDiagnostics; + private readonly ExascaleDbNodesRestOperations _exascaleDbNodeRestClient; + + /// Initializes a new instance of the class for mocking. + protected ExascaleDbNodeCollection() + { + } + + /// 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 ExascaleDbNodeCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _exascaleDbNodeClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ExascaleDbNodeResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ExascaleDbNodeResource.ResourceType, out string exascaleDbNodeApiVersion); + _exascaleDbNodeRestClient = new ExascaleDbNodesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, exascaleDbNodeApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ExadbVmClusterResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ExadbVmClusterResource.ResourceType), nameof(id)); + } + + /// + /// Get a ExascaleDbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string exascaleDbNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDbNodeName, nameof(exascaleDbNodeName)); + + using var scope = _exascaleDbNodeClientDiagnostics.CreateScope("ExascaleDbNodeCollection.Get"); + scope.Start(); + try + { + var response = await _exascaleDbNodeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exascaleDbNodeName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExascaleDbNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExascaleDbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string exascaleDbNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDbNodeName, nameof(exascaleDbNodeName)); + + using var scope = _exascaleDbNodeClientDiagnostics.CreateScope("ExascaleDbNodeCollection.Get"); + scope.Start(); + try + { + var response = _exascaleDbNodeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exascaleDbNodeName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExascaleDbNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List ExascaleDbNode resources by ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes + /// + /// + /// Operation Id + /// ExascaleDbNode_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-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) => _exascaleDbNodeRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exascaleDbNodeRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExascaleDbNodeResource(Client, ExascaleDbNodeData.DeserializeExascaleDbNodeData(e)), _exascaleDbNodeClientDiagnostics, Pipeline, "ExascaleDbNodeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List ExascaleDbNode resources by ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes + /// + /// + /// Operation Id + /// ExascaleDbNode_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-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) => _exascaleDbNodeRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exascaleDbNodeRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExascaleDbNodeResource(Client, ExascaleDbNodeData.DeserializeExascaleDbNodeData(e)), _exascaleDbNodeClientDiagnostics, Pipeline, "ExascaleDbNodeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string exascaleDbNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDbNodeName, nameof(exascaleDbNodeName)); + + using var scope = _exascaleDbNodeClientDiagnostics.CreateScope("ExascaleDbNodeCollection.Exists"); + scope.Start(); + try + { + var response = await _exascaleDbNodeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exascaleDbNodeName, 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string exascaleDbNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDbNodeName, nameof(exascaleDbNodeName)); + + using var scope = _exascaleDbNodeClientDiagnostics.CreateScope("ExascaleDbNodeCollection.Exists"); + scope.Start(); + try + { + var response = _exascaleDbNodeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exascaleDbNodeName, 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/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string exascaleDbNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDbNodeName, nameof(exascaleDbNodeName)); + + using var scope = _exascaleDbNodeClientDiagnostics.CreateScope("ExascaleDbNodeCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _exascaleDbNodeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exascaleDbNodeName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ExascaleDbNodeResource(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/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbNode. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string exascaleDbNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDbNodeName, nameof(exascaleDbNodeName)); + + using var scope = _exascaleDbNodeClientDiagnostics.CreateScope("ExascaleDbNodeCollection.GetIfExists"); + scope.Start(); + try + { + var response = _exascaleDbNodeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, exascaleDbNodeName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ExascaleDbNodeResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeData.Serialization.cs new file mode 100644 index 000000000000..c4396399a8f0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class ExascaleDbNodeData : 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(ExascaleDbNodeData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + ExascaleDbNodeData 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(ExascaleDbNodeData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDbNodeData(document.RootElement, options); + } + + internal static ExascaleDbNodeData DeserializeExascaleDbNodeData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExascaleDbNodeProperties 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 = ExascaleDbNodeProperties.DeserializeExascaleDbNodeProperties(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 ExascaleDbNodeData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExascaleDbNodeData)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDbNodeData 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 DeserializeExascaleDbNodeData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDbNodeData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeData.cs new file mode 100644 index 000000000000..737d4dec5154 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the ExascaleDbNode data model. + /// The DbNode resource belonging to ExadbVmCluster + /// + public partial class ExascaleDbNodeData : 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 ExascaleDbNodeData() + { + } + + /// 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 ExascaleDbNodeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ExascaleDbNodeProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public ExascaleDbNodeProperties Properties { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeResource.Serialization.cs new file mode 100644 index 000000000000..df517032390b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeResource.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.OracleDatabase +{ + public partial class ExascaleDbNodeResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ExascaleDbNodeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ExascaleDbNodeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeResource.cs new file mode 100644 index 000000000000..ea7d7924d7fe --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbNodeResource.cs @@ -0,0 +1,264 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing an ExascaleDbNode along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetExascaleDbNodeResource method. + /// Otherwise you can get one from its parent resource using the GetExascaleDbNode method. + /// + public partial class ExascaleDbNodeResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The exadbVmClusterName. + /// The exascaleDbNodeName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string exadbVmClusterName, string exascaleDbNodeName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _exascaleDbNodeClientDiagnostics; + private readonly ExascaleDbNodesRestOperations _exascaleDbNodeRestClient; + private readonly ExascaleDbNodeData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/exadbVmClusters/dbNodes"; + + /// Initializes a new instance of the class for mocking. + protected ExascaleDbNodeResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ExascaleDbNodeResource(ArmClient client, ExascaleDbNodeData 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 ExascaleDbNodeResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _exascaleDbNodeClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string exascaleDbNodeApiVersion); + _exascaleDbNodeRestClient = new ExascaleDbNodesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, exascaleDbNodeApiVersion); +#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 ExascaleDbNodeData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a ExascaleDbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _exascaleDbNodeClientDiagnostics.CreateScope("ExascaleDbNodeResource.Get"); + scope.Start(); + try + { + var response = await _exascaleDbNodeRestClient.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 ExascaleDbNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExascaleDbNode + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName} + /// + /// + /// Operation Id + /// ExascaleDbNode_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _exascaleDbNodeClientDiagnostics.CreateScope("ExascaleDbNodeResource.Get"); + scope.Start(); + try + { + var response = _exascaleDbNodeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExascaleDbNodeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// VM actions on DbNode of ExadbVmCluster by the provided filter + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName}/action + /// + /// + /// Operation Id + /// ExascaleDbNodes_Action + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> ActionAsync(WaitUntil waitUntil, DbNodeAction body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _exascaleDbNodeClientDiagnostics.CreateScope("ExascaleDbNodeResource.Action"); + scope.Start(); + try + { + var response = await _exascaleDbNodeRestClient.ActionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new DbActionResponseOperationSource(), _exascaleDbNodeClientDiagnostics, Pipeline, _exascaleDbNodeRestClient.CreateActionRequest(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; + } + } + + /// + /// VM actions on DbNode of ExadbVmCluster by the provided filter + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName}/dbNodes/{exascaleDbNodeName}/action + /// + /// + /// Operation Id + /// ExascaleDbNodes_Action + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Action(WaitUntil waitUntil, DbNodeAction body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _exascaleDbNodeClientDiagnostics.CreateScope("ExascaleDbNodeResource.Action"); + scope.Start(); + try + { + var response = _exascaleDbNodeRestClient.Action(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new OracleDatabaseArmOperation(new DbActionResponseOperationSource(), _exascaleDbNodeClientDiagnostics, Pipeline, _exascaleDbNodeRestClient.CreateActionRequest(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultCollection.cs new file mode 100644 index 000000000000..8fbc470afcf0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultCollection.cs @@ -0,0 +1,494 @@ +// 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.OracleDatabase +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetExascaleDbStorageVaults method from an instance of . + /// + public partial class ExascaleDbStorageVaultCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _exascaleDbStorageVaultClientDiagnostics; + private readonly ExascaleDbStorageVaultsRestOperations _exascaleDbStorageVaultRestClient; + + /// Initializes a new instance of the class for mocking. + protected ExascaleDbStorageVaultCollection() + { + } + + /// 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 ExascaleDbStorageVaultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _exascaleDbStorageVaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ExascaleDbStorageVaultResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ExascaleDbStorageVaultResource.ResourceType, out string exascaleDbStorageVaultApiVersion); + _exascaleDbStorageVaultRestClient = new ExascaleDbStorageVaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, exascaleDbStorageVaultApiVersion); +#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)); + } + + /// + /// Create a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Create + /// + /// + /// Default Api Version + /// 2025-03-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 name of the ExascaleDbStorageVault. + /// Resource create parameters. + /// 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 exascaleDbStorageVaultName, ExascaleDbStorageVaultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _exascaleDbStorageVaultRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, exascaleDbStorageVaultName, data, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new ExascaleDbStorageVaultOperationSource(Client), _exascaleDbStorageVaultClientDiagnostics, Pipeline, _exascaleDbStorageVaultRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, exascaleDbStorageVaultName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Create + /// + /// + /// Default Api Version + /// 2025-03-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 name of the ExascaleDbStorageVault. + /// Resource create parameters. + /// 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 exascaleDbStorageVaultName, ExascaleDbStorageVaultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _exascaleDbStorageVaultRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, exascaleDbStorageVaultName, data, cancellationToken); + var operation = new OracleDatabaseArmOperation(new ExascaleDbStorageVaultOperationSource(Client), _exascaleDbStorageVaultClientDiagnostics, Pipeline, _exascaleDbStorageVaultRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, exascaleDbStorageVaultName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string exascaleDbStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + + using var scope = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultCollection.Get"); + scope.Start(); + try + { + var response = await _exascaleDbStorageVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, exascaleDbStorageVaultName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExascaleDbStorageVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string exascaleDbStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + + using var scope = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultCollection.Get"); + scope.Start(); + try + { + var response = _exascaleDbStorageVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, exascaleDbStorageVaultName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExascaleDbStorageVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List ExascaleDbStorageVault resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-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) => _exascaleDbStorageVaultRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exascaleDbStorageVaultRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExascaleDbStorageVaultResource(Client, ExascaleDbStorageVaultData.DeserializeExascaleDbStorageVaultData(e)), _exascaleDbStorageVaultClientDiagnostics, Pipeline, "ExascaleDbStorageVaultCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List ExascaleDbStorageVault resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-03-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) => _exascaleDbStorageVaultRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _exascaleDbStorageVaultRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExascaleDbStorageVaultResource(Client, ExascaleDbStorageVaultData.DeserializeExascaleDbStorageVaultData(e)), _exascaleDbStorageVaultClientDiagnostics, Pipeline, "ExascaleDbStorageVaultCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string exascaleDbStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + + using var scope = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultCollection.Exists"); + scope.Start(); + try + { + var response = await _exascaleDbStorageVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, exascaleDbStorageVaultName, 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string exascaleDbStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + + using var scope = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultCollection.Exists"); + scope.Start(); + try + { + var response = _exascaleDbStorageVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, exascaleDbStorageVaultName, 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string exascaleDbStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + + using var scope = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _exascaleDbStorageVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, exascaleDbStorageVaultName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ExascaleDbStorageVaultResource(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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string exascaleDbStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + + using var scope = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultCollection.GetIfExists"); + scope.Start(); + try + { + var response = _exascaleDbStorageVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, exascaleDbStorageVaultName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ExascaleDbStorageVaultResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultData.Serialization.cs new file mode 100644 index 000000000000..2e7a031dd086 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultData.Serialization.cs @@ -0,0 +1,204 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class ExascaleDbStorageVaultData : 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(ExascaleDbStorageVaultData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsCollectionDefined(Zones)) + { + writer.WritePropertyName("zones"u8); + writer.WriteStartArray(); + foreach (var item in Zones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + ExascaleDbStorageVaultData 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(ExascaleDbStorageVaultData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDbStorageVaultData(document.RootElement, options); + } + + internal static ExascaleDbStorageVaultData DeserializeExascaleDbStorageVaultData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExascaleDbStorageVaultProperties properties = default; + IList zones = 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 = ExascaleDbStorageVaultProperties.DeserializeExascaleDbStorageVaultProperties(property.Value, options); + continue; + } + if (property.NameEquals("zones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; + 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 ExascaleDbStorageVaultData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + zones ?? 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); + default: + throw new FormatException($"The model {nameof(ExascaleDbStorageVaultData)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDbStorageVaultData 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 DeserializeExascaleDbStorageVaultData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDbStorageVaultData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultData.cs new file mode 100644 index 000000000000..78ce1d7a5bbb --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultData.cs @@ -0,0 +1,88 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the ExascaleDbStorageVault data model. + /// ExascaleDbStorageVault resource definition + /// + public partial class ExascaleDbStorageVaultData : 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 ExascaleDbStorageVaultData(AzureLocation location) : base(location) + { + Zones = new ChangeTrackingList(); + } + + /// 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 availability zones. + /// Keeps track of any properties unknown to the library. + internal ExascaleDbStorageVaultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExascaleDbStorageVaultProperties properties, IList zones, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Zones = zones; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExascaleDbStorageVaultData() + { + } + + /// The resource-specific properties for this resource. + public ExascaleDbStorageVaultProperties Properties { get; set; } + /// The availability zones. + public IList Zones { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultResource.Serialization.cs new file mode 100644 index 000000000000..cff23d4ce5d5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultResource.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.OracleDatabase +{ + public partial class ExascaleDbStorageVaultResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ExascaleDbStorageVaultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ExascaleDbStorageVaultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultResource.cs new file mode 100644 index 000000000000..fb51019e2fa0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ExascaleDbStorageVaultResource.cs @@ -0,0 +1,707 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing an ExascaleDbStorageVault along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetExascaleDbStorageVaultResource method. + /// Otherwise you can get one from its parent resource using the GetExascaleDbStorageVault method. + /// + public partial class ExascaleDbStorageVaultResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The exascaleDbStorageVaultName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string exascaleDbStorageVaultName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _exascaleDbStorageVaultClientDiagnostics; + private readonly ExascaleDbStorageVaultsRestOperations _exascaleDbStorageVaultRestClient; + private readonly ExascaleDbStorageVaultData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/exascaleDbStorageVaults"; + + /// Initializes a new instance of the class for mocking. + protected ExascaleDbStorageVaultResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ExascaleDbStorageVaultResource(ArmClient client, ExascaleDbStorageVaultData 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 ExascaleDbStorageVaultResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _exascaleDbStorageVaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string exascaleDbStorageVaultApiVersion); + _exascaleDbStorageVaultRestClient = new ExascaleDbStorageVaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, exascaleDbStorageVaultApiVersion); +#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 ExascaleDbStorageVaultData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultResource.Get"); + scope.Start(); + try + { + var response = await _exascaleDbStorageVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExascaleDbStorageVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultResource.Get"); + scope.Start(); + try + { + var response = _exascaleDbStorageVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExascaleDbStorageVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultResource.Delete"); + scope.Start(); + try + { + var response = await _exascaleDbStorageVaultRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_exascaleDbStorageVaultClientDiagnostics, Pipeline, _exascaleDbStorageVaultRestClient.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; + } + } + + /// + /// Delete a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultResource.Delete"); + scope.Start(); + try + { + var response = _exascaleDbStorageVaultRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new OracleDatabaseArmOperation(_exascaleDbStorageVaultClientDiagnostics, Pipeline, _exascaleDbStorageVaultRestClient.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; + } + } + + /// + /// Update a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ExascaleDbStorageVaultPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultResource.Update"); + scope.Start(); + try + { + var response = await _exascaleDbStorageVaultRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new ExascaleDbStorageVaultOperationSource(Client), _exascaleDbStorageVaultClientDiagnostics, Pipeline, _exascaleDbStorageVaultRestClient.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; + } + } + + /// + /// Update a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ExascaleDbStorageVaultPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultResource.Update"); + scope.Start(); + try + { + var response = _exascaleDbStorageVaultRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new OracleDatabaseArmOperation(new ExascaleDbStorageVaultOperationSource(Client), _exascaleDbStorageVaultClientDiagnostics, Pipeline, _exascaleDbStorageVaultRestClient.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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultResource.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 _exascaleDbStorageVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ExascaleDbStorageVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ExascaleDbStorageVaultPatch(); + 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultResource.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 = _exascaleDbStorageVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ExascaleDbStorageVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ExascaleDbStorageVaultPatch(); + 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultResource.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 _exascaleDbStorageVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ExascaleDbStorageVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ExascaleDbStorageVaultPatch(); + 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultResource.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 = _exascaleDbStorageVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ExascaleDbStorageVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ExascaleDbStorageVaultPatch(); + 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultResource.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 _exascaleDbStorageVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ExascaleDbStorageVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ExascaleDbStorageVaultPatch(); + 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/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-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 = _exascaleDbStorageVaultClientDiagnostics.CreateScope("ExascaleDbStorageVaultResource.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 = _exascaleDbStorageVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ExascaleDbStorageVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ExascaleDbStorageVaultPatch(); + 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseArmClient.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseArmClient.cs new file mode 100644 index 000000000000..84c6ba6dc360 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseArmClient.cs @@ -0,0 +1,289 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.OracleDatabase.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableOracleDatabaseArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableOracleDatabaseArmClient() + { + } + + /// 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 MockableOracleDatabaseArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableOracleDatabaseArmClient(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 CloudExadataInfrastructureResource GetCloudExadataInfrastructureResource(ResourceIdentifier id) + { + CloudExadataInfrastructureResource.ValidateResourceId(id); + return new CloudExadataInfrastructureResource(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 DbServerResource GetDbServerResource(ResourceIdentifier id) + { + DbServerResource.ValidateResourceId(id); + return new DbServerResource(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 CloudVmClusterResource GetCloudVmClusterResource(ResourceIdentifier id) + { + CloudVmClusterResource.ValidateResourceId(id); + return new CloudVmClusterResource(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 VirtualNetworkAddressResource GetVirtualNetworkAddressResource(ResourceIdentifier id) + { + VirtualNetworkAddressResource.ValidateResourceId(id); + return new VirtualNetworkAddressResource(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 SystemVersionResource GetSystemVersionResource(ResourceIdentifier id) + { + SystemVersionResource.ValidateResourceId(id); + return new SystemVersionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual OracleSubscriptionResource GetOracleSubscriptionResource(ResourceIdentifier id) + { + OracleSubscriptionResource.ValidateResourceId(id); + return new OracleSubscriptionResource(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 DbNodeResource GetDbNodeResource(ResourceIdentifier id) + { + DbNodeResource.ValidateResourceId(id); + return new DbNodeResource(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 GiVersionResource GetGiVersionResource(ResourceIdentifier id) + { + GiVersionResource.ValidateResourceId(id); + return new GiVersionResource(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 GiMinorVersionResource GetGiMinorVersionResource(ResourceIdentifier id) + { + GiMinorVersionResource.ValidateResourceId(id); + return new GiMinorVersionResource(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 DbSystemShapeResource GetDbSystemShapeResource(ResourceIdentifier id) + { + DbSystemShapeResource.ValidateResourceId(id); + return new DbSystemShapeResource(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 DnsPrivateViewResource GetDnsPrivateViewResource(ResourceIdentifier id) + { + DnsPrivateViewResource.ValidateResourceId(id); + return new DnsPrivateViewResource(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 DnsPrivateZoneResource GetDnsPrivateZoneResource(ResourceIdentifier id) + { + DnsPrivateZoneResource.ValidateResourceId(id); + return new DnsPrivateZoneResource(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 FlexComponentResource GetFlexComponentResource(ResourceIdentifier id) + { + FlexComponentResource.ValidateResourceId(id); + return new FlexComponentResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutonomousDatabaseResource GetAutonomousDatabaseResource(ResourceIdentifier id) + { + AutonomousDatabaseResource.ValidateResourceId(id); + return new AutonomousDatabaseResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutonomousDatabaseBackupResource GetAutonomousDatabaseBackupResource(ResourceIdentifier id) + { + AutonomousDatabaseBackupResource.ValidateResourceId(id); + return new AutonomousDatabaseBackupResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutonomousDatabaseCharacterSetResource GetAutonomousDatabaseCharacterSetResource(ResourceIdentifier id) + { + AutonomousDatabaseCharacterSetResource.ValidateResourceId(id); + return new AutonomousDatabaseCharacterSetResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutonomousDatabaseNationalCharacterSetResource GetAutonomousDatabaseNationalCharacterSetResource(ResourceIdentifier id) + { + AutonomousDatabaseNationalCharacterSetResource.ValidateResourceId(id); + return new AutonomousDatabaseNationalCharacterSetResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutonomousDbVersionResource GetAutonomousDbVersionResource(ResourceIdentifier id) + { + AutonomousDbVersionResource.ValidateResourceId(id); + return new AutonomousDbVersionResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExadbVmClusterResource GetExadbVmClusterResource(ResourceIdentifier id) + { + ExadbVmClusterResource.ValidateResourceId(id); + return new ExadbVmClusterResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExascaleDbNodeResource GetExascaleDbNodeResource(ResourceIdentifier id) + { + ExascaleDbNodeResource.ValidateResourceId(id); + return new ExascaleDbNodeResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ExascaleDbStorageVaultResource GetExascaleDbStorageVaultResource(ResourceIdentifier id) + { + ExascaleDbStorageVaultResource.ValidateResourceId(id); + return new ExascaleDbStorageVaultResource(Client, id); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseResourceGroupResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseResourceGroupResource.cs new file mode 100644 index 000000000000..7650ba2c8df1 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseResourceGroupResource.cs @@ -0,0 +1,381 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.OracleDatabase.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableOracleDatabaseResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableOracleDatabaseResourceGroupResource() + { + } + + /// 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 MockableOracleDatabaseResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of CloudExadataInfrastructureResources in the ResourceGroupResource. + /// An object representing collection of CloudExadataInfrastructureResources and their operations over a CloudExadataInfrastructureResource. + public virtual CloudExadataInfrastructureCollection GetCloudExadataInfrastructures() + { + return GetCachedClient(client => new CloudExadataInfrastructureCollection(client, Id)); + } + + /// + /// Get a CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudExadataInfrastructure name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCloudExadataInfrastructureAsync(string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + return await GetCloudExadataInfrastructures().GetAsync(cloudexadatainfrastructurename, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudExadataInfrastructure name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCloudExadataInfrastructure(string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + return GetCloudExadataInfrastructures().Get(cloudexadatainfrastructurename, cancellationToken); + } + + /// Gets a collection of CloudVmClusterResources in the ResourceGroupResource. + /// An object representing collection of CloudVmClusterResources and their operations over a CloudVmClusterResource. + public virtual CloudVmClusterCollection GetCloudVmClusters() + { + return GetCachedClient(client => new CloudVmClusterCollection(client, Id)); + } + + /// + /// Get a CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudVmCluster name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCloudVmClusterAsync(string cloudvmclustername, CancellationToken cancellationToken = default) + { + return await GetCloudVmClusters().GetAsync(cloudvmclustername, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// CloudVmCluster name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCloudVmCluster(string cloudvmclustername, CancellationToken cancellationToken = default) + { + return GetCloudVmClusters().Get(cloudvmclustername, cancellationToken); + } + + /// Gets a collection of AutonomousDatabaseResources in the ResourceGroupResource. + /// An object representing collection of AutonomousDatabaseResources and their operations over a AutonomousDatabaseResource. + public virtual AutonomousDatabaseCollection GetAutonomousDatabases() + { + return GetCachedClient(client => new AutonomousDatabaseCollection(client, Id)); + } + + /// + /// Get a AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutonomousDatabaseAsync(string autonomousdatabasename, CancellationToken cancellationToken = default) + { + return await GetAutonomousDatabases().GetAsync(autonomousdatabasename, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The database name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutonomousDatabase(string autonomousdatabasename, CancellationToken cancellationToken = default) + { + return GetAutonomousDatabases().Get(autonomousdatabasename, cancellationToken); + } + + /// Gets a collection of ExadbVmClusterResources in the ResourceGroupResource. + /// An object representing collection of ExadbVmClusterResources and their operations over a ExadbVmClusterResource. + public virtual ExadbVmClusterCollection GetExadbVmClusters() + { + return GetCachedClient(client => new ExadbVmClusterCollection(client, Id)); + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetExadbVmClusterAsync(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + return await GetExadbVmClusters().GetAsync(exadbVmClusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetExadbVmCluster(string exadbVmClusterName, CancellationToken cancellationToken = default) + { + return GetExadbVmClusters().Get(exadbVmClusterName, cancellationToken); + } + + /// Gets a collection of ExascaleDbStorageVaultResources in the ResourceGroupResource. + /// An object representing collection of ExascaleDbStorageVaultResources and their operations over a ExascaleDbStorageVaultResource. + public virtual ExascaleDbStorageVaultCollection GetExascaleDbStorageVaults() + { + return GetCachedClient(client => new ExascaleDbStorageVaultCollection(client, Id)); + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetExascaleDbStorageVaultAsync(string exascaleDbStorageVaultName, CancellationToken cancellationToken = default) + { + return await GetExascaleDbStorageVaults().GetAsync(exascaleDbStorageVaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetExascaleDbStorageVault(string exascaleDbStorageVaultName, CancellationToken cancellationToken = default) + { + return GetExascaleDbStorageVaults().Get(exascaleDbStorageVaultName, cancellationToken); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseSubscriptionResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseSubscriptionResource.cs new file mode 100644 index 000000000000..57108cb076c5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/MockableOracleDatabaseSubscriptionResource.cs @@ -0,0 +1,1015 @@ +// 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; + +namespace Azure.ResourceManager.OracleDatabase.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableOracleDatabaseSubscriptionResource : ArmResource + { + private ClientDiagnostics _cloudExadataInfrastructureClientDiagnostics; + private CloudExadataInfrastructuresRestOperations _cloudExadataInfrastructureRestClient; + private ClientDiagnostics _cloudVmClusterClientDiagnostics; + private CloudVmClustersRestOperations _cloudVmClusterRestClient; + private ClientDiagnostics _autonomousDatabaseClientDiagnostics; + private AutonomousDatabasesRestOperations _autonomousDatabaseRestClient; + private ClientDiagnostics _exadbVmClusterClientDiagnostics; + private ExadbVmClustersRestOperations _exadbVmClusterRestClient; + private ClientDiagnostics _exascaleDbStorageVaultClientDiagnostics; + private ExascaleDbStorageVaultsRestOperations _exascaleDbStorageVaultRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableOracleDatabaseSubscriptionResource() + { + } + + /// 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 MockableOracleDatabaseSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics CloudExadataInfrastructureClientDiagnostics => _cloudExadataInfrastructureClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", CloudExadataInfrastructureResource.ResourceType.Namespace, Diagnostics); + private CloudExadataInfrastructuresRestOperations CloudExadataInfrastructureRestClient => _cloudExadataInfrastructureRestClient ??= new CloudExadataInfrastructuresRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CloudExadataInfrastructureResource.ResourceType)); + private ClientDiagnostics CloudVmClusterClientDiagnostics => _cloudVmClusterClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", CloudVmClusterResource.ResourceType.Namespace, Diagnostics); + private CloudVmClustersRestOperations CloudVmClusterRestClient => _cloudVmClusterRestClient ??= new CloudVmClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CloudVmClusterResource.ResourceType)); + private ClientDiagnostics AutonomousDatabaseClientDiagnostics => _autonomousDatabaseClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", AutonomousDatabaseResource.ResourceType.Namespace, Diagnostics); + private AutonomousDatabasesRestOperations AutonomousDatabaseRestClient => _autonomousDatabaseRestClient ??= new AutonomousDatabasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(AutonomousDatabaseResource.ResourceType)); + private ClientDiagnostics ExadbVmClusterClientDiagnostics => _exadbVmClusterClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ExadbVmClusterResource.ResourceType.Namespace, Diagnostics); + private ExadbVmClustersRestOperations ExadbVmClusterRestClient => _exadbVmClusterRestClient ??= new ExadbVmClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ExadbVmClusterResource.ResourceType)); + private ClientDiagnostics ExascaleDbStorageVaultClientDiagnostics => _exascaleDbStorageVaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ExascaleDbStorageVaultResource.ResourceType.Namespace, Diagnostics); + private ExascaleDbStorageVaultsRestOperations ExascaleDbStorageVaultRestClient => _exascaleDbStorageVaultRestClient ??= new ExascaleDbStorageVaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ExascaleDbStorageVaultResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of SystemVersionResources in the SubscriptionResource. + /// The name of the Azure region. + /// An object representing collection of SystemVersionResources and their operations over a SystemVersionResource. + public virtual SystemVersionCollection GetSystemVersions(AzureLocation location) + { + return new SystemVersionCollection(Client, Id, location); + } + + /// + /// Get a SystemVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname} + /// + /// + /// Operation Id + /// SystemVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// SystemVersion name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSystemVersionAsync(AzureLocation location, string systemversionname, CancellationToken cancellationToken = default) + { + return await GetSystemVersions(location).GetAsync(systemversionname, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SystemVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname} + /// + /// + /// Operation Id + /// SystemVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// SystemVersion name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSystemVersion(AzureLocation location, string systemversionname, CancellationToken cancellationToken = default) + { + return GetSystemVersions(location).Get(systemversionname, cancellationToken); + } + + /// Gets an object representing a OracleSubscriptionResource along with the instance operations that can be performed on it in the SubscriptionResource. + /// Returns a object. + public virtual OracleSubscriptionResource GetOracleSubscription() + { + return new OracleSubscriptionResource(Client, Id.AppendProviderResource("Oracle.Database", "oracleSubscriptions", "default")); + } + + /// Gets a collection of GiVersionResources in the SubscriptionResource. + /// The name of the Azure region. + /// An object representing collection of GiVersionResources and their operations over a GiVersionResource. + public virtual GiVersionCollection GetGiVersions(AzureLocation location) + { + return new GiVersionCollection(Client, Id, location); + } + + /// + /// Get a GiVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname} + /// + /// + /// Operation Id + /// GiVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// GiVersion name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGiVersionAsync(AzureLocation location, string giversionname, CancellationToken cancellationToken = default) + { + return await GetGiVersions(location).GetAsync(giversionname, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a GiVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname} + /// + /// + /// Operation Id + /// GiVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// GiVersion name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGiVersion(AzureLocation location, string giversionname, CancellationToken cancellationToken = default) + { + return GetGiVersions(location).Get(giversionname, cancellationToken); + } + + /// Gets a collection of DbSystemShapeResources in the SubscriptionResource. + /// The name of the Azure region. + /// An object representing collection of DbSystemShapeResources and their operations over a DbSystemShapeResource. + public virtual DbSystemShapeCollection GetDbSystemShapes(AzureLocation location) + { + return new DbSystemShapeCollection(Client, Id, location); + } + + /// + /// Get a DbSystemShape + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename} + /// + /// + /// Operation Id + /// DbSystemShape_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// DbSystemShape name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDbSystemShapeAsync(AzureLocation location, string dbsystemshapename, CancellationToken cancellationToken = default) + { + return await GetDbSystemShapes(location).GetAsync(dbsystemshapename, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DbSystemShape + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename} + /// + /// + /// Operation Id + /// DbSystemShape_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// DbSystemShape name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDbSystemShape(AzureLocation location, string dbsystemshapename, CancellationToken cancellationToken = default) + { + return GetDbSystemShapes(location).Get(dbsystemshapename, cancellationToken); + } + + /// Gets a collection of DnsPrivateViewResources in the SubscriptionResource. + /// The name of the Azure region. + /// An object representing collection of DnsPrivateViewResources and their operations over a DnsPrivateViewResource. + public virtual DnsPrivateViewCollection GetDnsPrivateViews(AzureLocation location) + { + return new DnsPrivateViewCollection(Client, Id, location); + } + + /// + /// Get a DnsPrivateView + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid} + /// + /// + /// Operation Id + /// DnsPrivateView_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// DnsPrivateView OCID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDnsPrivateViewAsync(AzureLocation location, string dnsprivateviewocid, CancellationToken cancellationToken = default) + { + return await GetDnsPrivateViews(location).GetAsync(dnsprivateviewocid, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DnsPrivateView + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid} + /// + /// + /// Operation Id + /// DnsPrivateView_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// DnsPrivateView OCID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDnsPrivateView(AzureLocation location, string dnsprivateviewocid, CancellationToken cancellationToken = default) + { + return GetDnsPrivateViews(location).Get(dnsprivateviewocid, cancellationToken); + } + + /// Gets a collection of DnsPrivateZoneResources in the SubscriptionResource. + /// The name of the Azure region. + /// An object representing collection of DnsPrivateZoneResources and their operations over a DnsPrivateZoneResource. + public virtual DnsPrivateZoneCollection GetDnsPrivateZones(AzureLocation location) + { + return new DnsPrivateZoneCollection(Client, Id, location); + } + + /// + /// Get a DnsPrivateZone + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename} + /// + /// + /// Operation Id + /// DnsPrivateZone_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// DnsPrivateZone name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDnsPrivateZoneAsync(AzureLocation location, string dnsprivatezonename, CancellationToken cancellationToken = default) + { + return await GetDnsPrivateZones(location).GetAsync(dnsprivatezonename, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DnsPrivateZone + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename} + /// + /// + /// Operation Id + /// DnsPrivateZone_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// DnsPrivateZone name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDnsPrivateZone(AzureLocation location, string dnsprivatezonename, CancellationToken cancellationToken = default) + { + return GetDnsPrivateZones(location).Get(dnsprivatezonename, cancellationToken); + } + + /// Gets a collection of FlexComponentResources in the SubscriptionResource. + /// The name of the Azure region. + /// An object representing collection of FlexComponentResources and their operations over a FlexComponentResource. + public virtual FlexComponentCollection GetFlexComponents(AzureLocation location) + { + return new FlexComponentCollection(Client, Id, location); + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponent_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFlexComponentAsync(AzureLocation location, string flexComponentName, CancellationToken cancellationToken = default) + { + return await GetFlexComponents(location).GetAsync(flexComponentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponent_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFlexComponent(AzureLocation location, string flexComponentName, CancellationToken cancellationToken = default) + { + return GetFlexComponents(location).Get(flexComponentName, cancellationToken); + } + + /// Gets a collection of AutonomousDatabaseCharacterSetResources in the SubscriptionResource. + /// The name of the Azure region. + /// An object representing collection of AutonomousDatabaseCharacterSetResources and their operations over a AutonomousDatabaseCharacterSetResource. + public virtual AutonomousDatabaseCharacterSetCollection GetAutonomousDatabaseCharacterSets(AzureLocation location) + { + return new AutonomousDatabaseCharacterSetCollection(Client, Id, location); + } + + /// + /// Get a AutonomousDatabaseCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// AutonomousDatabaseCharacterSet name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutonomousDatabaseCharacterSetAsync(AzureLocation location, string adbscharsetname, CancellationToken cancellationToken = default) + { + return await GetAutonomousDatabaseCharacterSets(location).GetAsync(adbscharsetname, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AutonomousDatabaseCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// AutonomousDatabaseCharacterSet name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutonomousDatabaseCharacterSet(AzureLocation location, string adbscharsetname, CancellationToken cancellationToken = default) + { + return GetAutonomousDatabaseCharacterSets(location).Get(adbscharsetname, cancellationToken); + } + + /// Gets a collection of AutonomousDatabaseNationalCharacterSetResources in the SubscriptionResource. + /// The name of the Azure region. + /// An object representing collection of AutonomousDatabaseNationalCharacterSetResources and their operations over a AutonomousDatabaseNationalCharacterSetResource. + public virtual AutonomousDatabaseNationalCharacterSetCollection GetAutonomousDatabaseNationalCharacterSets(AzureLocation location) + { + return new AutonomousDatabaseNationalCharacterSetCollection(Client, Id, location); + } + + /// + /// Get a AutonomousDatabaseNationalCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseNationalCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// AutonomousDatabaseNationalCharacterSets name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutonomousDatabaseNationalCharacterSetAsync(AzureLocation location, string adbsncharsetname, CancellationToken cancellationToken = default) + { + return await GetAutonomousDatabaseNationalCharacterSets(location).GetAsync(adbsncharsetname, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AutonomousDatabaseNationalCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseNationalCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// AutonomousDatabaseNationalCharacterSets name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutonomousDatabaseNationalCharacterSet(AzureLocation location, string adbsncharsetname, CancellationToken cancellationToken = default) + { + return GetAutonomousDatabaseNationalCharacterSets(location).Get(adbsncharsetname, cancellationToken); + } + + /// Gets a collection of AutonomousDbVersionResources in the SubscriptionResource. + /// The name of the Azure region. + /// An object representing collection of AutonomousDbVersionResources and their operations over a AutonomousDbVersionResource. + public virtual AutonomousDbVersionCollection GetAutonomousDbVersions(AzureLocation location) + { + return new AutonomousDbVersionCollection(Client, Id, location); + } + + /// + /// Get a AutonomousDbVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname} + /// + /// + /// Operation Id + /// AutonomousDbVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// AutonomousDbVersion name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutonomousDbVersionAsync(AzureLocation location, string autonomousdbversionsname, CancellationToken cancellationToken = default) + { + return await GetAutonomousDbVersions(location).GetAsync(autonomousdbversionsname, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AutonomousDbVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname} + /// + /// + /// Operation Id + /// AutonomousDbVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// AutonomousDbVersion name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutonomousDbVersion(AzureLocation location, string autonomousdbversionsname, CancellationToken cancellationToken = default) + { + return GetAutonomousDbVersions(location).Get(autonomousdbversionsname, cancellationToken); + } + + /// + /// List CloudExadataInfrastructure resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/cloudExadataInfrastructures + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetCloudExadataInfrastructuresAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CloudExadataInfrastructureRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CloudExadataInfrastructureRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CloudExadataInfrastructureResource(Client, CloudExadataInfrastructureData.DeserializeCloudExadataInfrastructureData(e)), CloudExadataInfrastructureClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetCloudExadataInfrastructures", "value", "nextLink", cancellationToken); + } + + /// + /// List CloudExadataInfrastructure resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/cloudExadataInfrastructures + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetCloudExadataInfrastructures(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CloudExadataInfrastructureRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CloudExadataInfrastructureRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CloudExadataInfrastructureResource(Client, CloudExadataInfrastructureData.DeserializeCloudExadataInfrastructureData(e)), CloudExadataInfrastructureClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetCloudExadataInfrastructures", "value", "nextLink", cancellationToken); + } + + /// + /// List CloudVmCluster resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/cloudVmClusters + /// + /// + /// Operation Id + /// CloudVmCluster_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetCloudVmClustersAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CloudVmClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CloudVmClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CloudVmClusterResource(Client, CloudVmClusterData.DeserializeCloudVmClusterData(e)), CloudVmClusterClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetCloudVmClusters", "value", "nextLink", cancellationToken); + } + + /// + /// List CloudVmCluster resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/cloudVmClusters + /// + /// + /// Operation Id + /// CloudVmCluster_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetCloudVmClusters(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => CloudVmClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CloudVmClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CloudVmClusterResource(Client, CloudVmClusterData.DeserializeCloudVmClusterData(e)), CloudVmClusterClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetCloudVmClusters", "value", "nextLink", cancellationToken); + } + + /// + /// List AutonomousDatabase resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/autonomousDatabases + /// + /// + /// Operation Id + /// AutonomousDatabase_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAutonomousDatabasesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => AutonomousDatabaseRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AutonomousDatabaseRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutonomousDatabaseResource(Client, AutonomousDatabaseData.DeserializeAutonomousDatabaseData(e)), AutonomousDatabaseClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetAutonomousDatabases", "value", "nextLink", cancellationToken); + } + + /// + /// List AutonomousDatabase resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/autonomousDatabases + /// + /// + /// Operation Id + /// AutonomousDatabase_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAutonomousDatabases(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => AutonomousDatabaseRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AutonomousDatabaseRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutonomousDatabaseResource(Client, AutonomousDatabaseData.DeserializeAutonomousDatabaseData(e)), AutonomousDatabaseClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetAutonomousDatabases", "value", "nextLink", cancellationToken); + } + + /// + /// List ExadbVmCluster resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exadbVmClusters + /// + /// + /// Operation Id + /// ExadbVmCluster_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetExadbVmClustersAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ExadbVmClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExadbVmClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExadbVmClusterResource(Client, ExadbVmClusterData.DeserializeExadbVmClusterData(e)), ExadbVmClusterClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetExadbVmClusters", "value", "nextLink", cancellationToken); + } + + /// + /// List ExadbVmCluster resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exadbVmClusters + /// + /// + /// Operation Id + /// ExadbVmCluster_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetExadbVmClusters(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ExadbVmClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExadbVmClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExadbVmClusterResource(Client, ExadbVmClusterData.DeserializeExadbVmClusterData(e)), ExadbVmClusterClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetExadbVmClusters", "value", "nextLink", cancellationToken); + } + + /// + /// List ExascaleDbStorageVault resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exascaleDbStorageVaults + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetExascaleDbStorageVaultsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ExascaleDbStorageVaultRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExascaleDbStorageVaultRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ExascaleDbStorageVaultResource(Client, ExascaleDbStorageVaultData.DeserializeExascaleDbStorageVaultData(e)), ExascaleDbStorageVaultClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetExascaleDbStorageVaults", "value", "nextLink", cancellationToken); + } + + /// + /// List ExascaleDbStorageVault resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exascaleDbStorageVaults + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetExascaleDbStorageVaults(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ExascaleDbStorageVaultRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExascaleDbStorageVaultRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ExascaleDbStorageVaultResource(Client, ExascaleDbStorageVaultData.DeserializeExascaleDbStorageVaultData(e)), ExascaleDbStorageVaultClientDiagnostics, Pipeline, "MockableOracleDatabaseSubscriptionResource.GetExascaleDbStorageVaults", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/OracleDatabaseExtensions.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/OracleDatabaseExtensions.cs new file mode 100644 index 000000000000..4a2aebf71590 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Extensions/OracleDatabaseExtensions.cs @@ -0,0 +1,2140 @@ +// 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.OracleDatabase.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// A class to add extension methods to Azure.ResourceManager.OracleDatabase. + public static partial class OracleDatabaseExtensions + { + private static MockableOracleDatabaseArmClient GetMockableOracleDatabaseArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableOracleDatabaseArmClient(client0)); + } + + private static MockableOracleDatabaseResourceGroupResource GetMockableOracleDatabaseResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableOracleDatabaseResourceGroupResource(client, resource.Id)); + } + + private static MockableOracleDatabaseSubscriptionResource GetMockableOracleDatabaseSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableOracleDatabaseSubscriptionResource(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 CloudExadataInfrastructureResource GetCloudExadataInfrastructureResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetCloudExadataInfrastructureResource(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 DbServerResource GetDbServerResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetDbServerResource(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 CloudVmClusterResource GetCloudVmClusterResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetCloudVmClusterResource(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 VirtualNetworkAddressResource GetVirtualNetworkAddressResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetVirtualNetworkAddressResource(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 SystemVersionResource GetSystemVersionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetSystemVersionResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// 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 OracleSubscriptionResource GetOracleSubscriptionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetOracleSubscriptionResource(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 DbNodeResource GetDbNodeResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetDbNodeResource(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 GiVersionResource GetGiVersionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetGiVersionResource(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 GiMinorVersionResource GetGiMinorVersionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetGiMinorVersionResource(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 DbSystemShapeResource GetDbSystemShapeResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetDbSystemShapeResource(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 DnsPrivateViewResource GetDnsPrivateViewResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetDnsPrivateViewResource(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 DnsPrivateZoneResource GetDnsPrivateZoneResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetDnsPrivateZoneResource(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 FlexComponentResource GetFlexComponentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetFlexComponentResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// 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 AutonomousDatabaseResource GetAutonomousDatabaseResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetAutonomousDatabaseResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// 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 AutonomousDatabaseBackupResource GetAutonomousDatabaseBackupResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetAutonomousDatabaseBackupResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// 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 AutonomousDatabaseCharacterSetResource GetAutonomousDatabaseCharacterSetResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetAutonomousDatabaseCharacterSetResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// 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 AutonomousDatabaseNationalCharacterSetResource GetAutonomousDatabaseNationalCharacterSetResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetAutonomousDatabaseNationalCharacterSetResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// 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 AutonomousDbVersionResource GetAutonomousDbVersionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetAutonomousDbVersionResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// 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 ExadbVmClusterResource GetExadbVmClusterResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetExadbVmClusterResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// 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 ExascaleDbNodeResource GetExascaleDbNodeResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetExascaleDbNodeResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// 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 ExascaleDbStorageVaultResource GetExascaleDbStorageVaultResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableOracleDatabaseArmClient(client).GetExascaleDbStorageVaultResource(id); + } + + /// + /// Gets a collection of CloudExadataInfrastructureResources 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 CloudExadataInfrastructureResources and their operations over a CloudExadataInfrastructureResource. + public static CloudExadataInfrastructureCollection GetCloudExadataInfrastructures(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetCloudExadataInfrastructures(); + } + + /// + /// Get a CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// CloudExadataInfrastructure 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> GetCloudExadataInfrastructureAsync(this ResourceGroupResource resourceGroupResource, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetCloudExadataInfrastructureAsync(cloudexadatainfrastructurename, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a CloudExadataInfrastructure + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudExadataInfrastructures/{cloudexadatainfrastructurename} + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// CloudExadataInfrastructure name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetCloudExadataInfrastructure(this ResourceGroupResource resourceGroupResource, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetCloudExadataInfrastructure(cloudexadatainfrastructurename, cancellationToken); + } + + /// + /// Gets a collection of CloudVmClusterResources 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 CloudVmClusterResources and their operations over a CloudVmClusterResource. + public static CloudVmClusterCollection GetCloudVmClusters(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetCloudVmClusters(); + } + + /// + /// Get a CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// CloudVmCluster 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> GetCloudVmClusterAsync(this ResourceGroupResource resourceGroupResource, string cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetCloudVmClusterAsync(cloudvmclustername, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername} + /// + /// + /// Operation Id + /// CloudVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// CloudVmCluster name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetCloudVmCluster(this ResourceGroupResource resourceGroupResource, string cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetCloudVmCluster(cloudvmclustername, cancellationToken); + } + + /// + /// Gets a collection of AutonomousDatabaseResources 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 AutonomousDatabaseResources and their operations over a AutonomousDatabaseResource. + public static AutonomousDatabaseCollection GetAutonomousDatabases(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetAutonomousDatabases(); + } + + /// + /// Get a AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The database 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> GetAutonomousDatabaseAsync(this ResourceGroupResource resourceGroupResource, string autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetAutonomousDatabaseAsync(autonomousdatabasename, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AutonomousDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/autonomousDatabases/{autonomousdatabasename} + /// + /// + /// Operation Id + /// AutonomousDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The database name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetAutonomousDatabase(this ResourceGroupResource resourceGroupResource, string autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetAutonomousDatabase(autonomousdatabasename, cancellationToken); + } + + /// + /// Gets a collection of ExadbVmClusterResources 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 ExadbVmClusterResources and their operations over a ExadbVmClusterResource. + public static ExadbVmClusterCollection GetExadbVmClusters(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetExadbVmClusters(); + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetExadbVmClusterAsync(this ResourceGroupResource resourceGroupResource, string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetExadbVmClusterAsync(exadbVmClusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ExadbVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exadbVmClusters/{exadbVmClusterName} + /// + /// + /// Operation Id + /// ExadbVmCluster_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetExadbVmCluster(this ResourceGroupResource resourceGroupResource, string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetExadbVmCluster(exadbVmClusterName, cancellationToken); + } + + /// + /// Gets a collection of ExascaleDbStorageVaultResources 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 ExascaleDbStorageVaultResources and their operations over a ExascaleDbStorageVaultResource. + public static ExascaleDbStorageVaultCollection GetExascaleDbStorageVaults(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetExascaleDbStorageVaults(); + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetExascaleDbStorageVaultAsync(this ResourceGroupResource resourceGroupResource, string exascaleDbStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetExascaleDbStorageVaultAsync(exascaleDbStorageVaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a ExascaleDbStorageVault + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/exascaleDbStorageVaults/{exascaleDbStorageVaultName} + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the ExascaleDbStorageVault. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetExascaleDbStorageVault(this ResourceGroupResource resourceGroupResource, string exascaleDbStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableOracleDatabaseResourceGroupResource(resourceGroupResource).GetExascaleDbStorageVault(exascaleDbStorageVaultName, cancellationToken); + } + + /// + /// Gets a collection of SystemVersionResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// is null. + /// An object representing collection of SystemVersionResources and their operations over a SystemVersionResource. + public static SystemVersionCollection GetSystemVersions(this SubscriptionResource subscriptionResource, AzureLocation location) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetSystemVersions(location); + } + + /// + /// Get a SystemVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname} + /// + /// + /// Operation Id + /// SystemVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// SystemVersion 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> GetSystemVersionAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string systemversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetSystemVersionAsync(location, systemversionname, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a SystemVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname} + /// + /// + /// Operation Id + /// SystemVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// SystemVersion name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetSystemVersion(this SubscriptionResource subscriptionResource, AzureLocation location, string systemversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetSystemVersion(location, systemversionname, cancellationToken); + } + + /// + /// Gets an object representing a OracleSubscriptionResource along with the instance operations that can be performed on it in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// Returns a object. + public static OracleSubscriptionResource GetOracleSubscription(this SubscriptionResource subscriptionResource) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetOracleSubscription(); + } + + /// + /// Gets a collection of GiVersionResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// is null. + /// An object representing collection of GiVersionResources and their operations over a GiVersionResource. + public static GiVersionCollection GetGiVersions(this SubscriptionResource subscriptionResource, AzureLocation location) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetGiVersions(location); + } + + /// + /// Get a GiVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname} + /// + /// + /// Operation Id + /// GiVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// GiVersion 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> GetGiVersionAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string giversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetGiVersionAsync(location, giversionname, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a GiVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname} + /// + /// + /// Operation Id + /// GiVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// GiVersion name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetGiVersion(this SubscriptionResource subscriptionResource, AzureLocation location, string giversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetGiVersion(location, giversionname, cancellationToken); + } + + /// + /// Gets a collection of DbSystemShapeResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// is null. + /// An object representing collection of DbSystemShapeResources and their operations over a DbSystemShapeResource. + public static DbSystemShapeCollection GetDbSystemShapes(this SubscriptionResource subscriptionResource, AzureLocation location) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetDbSystemShapes(location); + } + + /// + /// Get a DbSystemShape + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename} + /// + /// + /// Operation Id + /// DbSystemShape_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// DbSystemShape 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> GetDbSystemShapeAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string dbsystemshapename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetDbSystemShapeAsync(location, dbsystemshapename, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DbSystemShape + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dbSystemShapes/{dbsystemshapename} + /// + /// + /// Operation Id + /// DbSystemShape_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// DbSystemShape name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDbSystemShape(this SubscriptionResource subscriptionResource, AzureLocation location, string dbsystemshapename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetDbSystemShape(location, dbsystemshapename, cancellationToken); + } + + /// + /// Gets a collection of DnsPrivateViewResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// is null. + /// An object representing collection of DnsPrivateViewResources and their operations over a DnsPrivateViewResource. + public static DnsPrivateViewCollection GetDnsPrivateViews(this SubscriptionResource subscriptionResource, AzureLocation location) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetDnsPrivateViews(location); + } + + /// + /// Get a DnsPrivateView + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid} + /// + /// + /// Operation Id + /// DnsPrivateView_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// DnsPrivateView OCID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDnsPrivateViewAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string dnsprivateviewocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetDnsPrivateViewAsync(location, dnsprivateviewocid, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DnsPrivateView + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateViews/{dnsprivateviewocid} + /// + /// + /// Operation Id + /// DnsPrivateView_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// DnsPrivateView OCID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDnsPrivateView(this SubscriptionResource subscriptionResource, AzureLocation location, string dnsprivateviewocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetDnsPrivateView(location, dnsprivateviewocid, cancellationToken); + } + + /// + /// Gets a collection of DnsPrivateZoneResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// is null. + /// An object representing collection of DnsPrivateZoneResources and their operations over a DnsPrivateZoneResource. + public static DnsPrivateZoneCollection GetDnsPrivateZones(this SubscriptionResource subscriptionResource, AzureLocation location) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetDnsPrivateZones(location); + } + + /// + /// Get a DnsPrivateZone + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename} + /// + /// + /// Operation Id + /// DnsPrivateZone_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// DnsPrivateZone 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> GetDnsPrivateZoneAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string dnsprivatezonename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetDnsPrivateZoneAsync(location, dnsprivatezonename, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a DnsPrivateZone + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/dnsPrivateZones/{dnsprivatezonename} + /// + /// + /// Operation Id + /// DnsPrivateZone_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// DnsPrivateZone name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDnsPrivateZone(this SubscriptionResource subscriptionResource, AzureLocation location, string dnsprivatezonename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetDnsPrivateZone(location, dnsprivatezonename, cancellationToken); + } + + /// + /// Gets a collection of FlexComponentResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// is null. + /// An object representing collection of FlexComponentResources and their operations over a FlexComponentResource. + public static FlexComponentCollection GetFlexComponents(this SubscriptionResource subscriptionResource, AzureLocation location) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetFlexComponents(location); + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponent_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The name of the FlexComponent. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetFlexComponentAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetFlexComponentAsync(location, flexComponentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponent_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The name of the FlexComponent. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetFlexComponent(this SubscriptionResource subscriptionResource, AzureLocation location, string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetFlexComponent(location, flexComponentName, cancellationToken); + } + + /// + /// Gets a collection of AutonomousDatabaseCharacterSetResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// is null. + /// An object representing collection of AutonomousDatabaseCharacterSetResources and their operations over a AutonomousDatabaseCharacterSetResource. + public static AutonomousDatabaseCharacterSetCollection GetAutonomousDatabaseCharacterSets(this SubscriptionResource subscriptionResource, AzureLocation location) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetAutonomousDatabaseCharacterSets(location); + } + + /// + /// Get a AutonomousDatabaseCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// AutonomousDatabaseCharacterSet 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> GetAutonomousDatabaseCharacterSetAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string adbscharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetAutonomousDatabaseCharacterSetAsync(location, adbscharsetname, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AutonomousDatabaseCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseCharacterSets/{adbscharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// AutonomousDatabaseCharacterSet name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetAutonomousDatabaseCharacterSet(this SubscriptionResource subscriptionResource, AzureLocation location, string adbscharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetAutonomousDatabaseCharacterSet(location, adbscharsetname, cancellationToken); + } + + /// + /// Gets a collection of AutonomousDatabaseNationalCharacterSetResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// is null. + /// An object representing collection of AutonomousDatabaseNationalCharacterSetResources and their operations over a AutonomousDatabaseNationalCharacterSetResource. + public static AutonomousDatabaseNationalCharacterSetCollection GetAutonomousDatabaseNationalCharacterSets(this SubscriptionResource subscriptionResource, AzureLocation location) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetAutonomousDatabaseNationalCharacterSets(location); + } + + /// + /// Get a AutonomousDatabaseNationalCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseNationalCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// AutonomousDatabaseNationalCharacterSets 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> GetAutonomousDatabaseNationalCharacterSetAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string adbsncharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetAutonomousDatabaseNationalCharacterSetAsync(location, adbsncharsetname, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AutonomousDatabaseNationalCharacterSet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDatabaseNationalCharacterSets/{adbsncharsetname} + /// + /// + /// Operation Id + /// AutonomousDatabaseNationalCharacterSet_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// AutonomousDatabaseNationalCharacterSets name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetAutonomousDatabaseNationalCharacterSet(this SubscriptionResource subscriptionResource, AzureLocation location, string adbsncharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetAutonomousDatabaseNationalCharacterSet(location, adbsncharsetname, cancellationToken); + } + + /// + /// Gets a collection of AutonomousDbVersionResources in the SubscriptionResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// is null. + /// An object representing collection of AutonomousDbVersionResources and their operations over a AutonomousDbVersionResource. + public static AutonomousDbVersionCollection GetAutonomousDbVersions(this SubscriptionResource subscriptionResource, AzureLocation location) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetAutonomousDbVersions(location); + } + + /// + /// Get a AutonomousDbVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname} + /// + /// + /// Operation Id + /// AutonomousDbVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// AutonomousDbVersion 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> GetAutonomousDbVersionAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string autonomousdbversionsname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetAutonomousDbVersionAsync(location, autonomousdbversionsname, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AutonomousDbVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/autonomousDbVersions/{autonomousdbversionsname} + /// + /// + /// Operation Id + /// AutonomousDbVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// AutonomousDbVersion name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetAutonomousDbVersion(this SubscriptionResource subscriptionResource, AzureLocation location, string autonomousdbversionsname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetAutonomousDbVersion(location, autonomousdbversionsname, cancellationToken); + } + + /// + /// List CloudExadataInfrastructure resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/cloudExadataInfrastructures + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-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 GetCloudExadataInfrastructuresAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetCloudExadataInfrastructuresAsync(cancellationToken); + } + + /// + /// List CloudExadataInfrastructure resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/cloudExadataInfrastructures + /// + /// + /// Operation Id + /// CloudExadataInfrastructure_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-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 GetCloudExadataInfrastructures(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetCloudExadataInfrastructures(cancellationToken); + } + + /// + /// List CloudVmCluster resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/cloudVmClusters + /// + /// + /// Operation Id + /// CloudVmCluster_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-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 GetCloudVmClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetCloudVmClustersAsync(cancellationToken); + } + + /// + /// List CloudVmCluster resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/cloudVmClusters + /// + /// + /// Operation Id + /// CloudVmCluster_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-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 GetCloudVmClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetCloudVmClusters(cancellationToken); + } + + /// + /// List AutonomousDatabase resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/autonomousDatabases + /// + /// + /// Operation Id + /// AutonomousDatabase_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-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 GetAutonomousDatabasesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetAutonomousDatabasesAsync(cancellationToken); + } + + /// + /// List AutonomousDatabase resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/autonomousDatabases + /// + /// + /// Operation Id + /// AutonomousDatabase_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-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 GetAutonomousDatabases(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetAutonomousDatabases(cancellationToken); + } + + /// + /// List ExadbVmCluster resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exadbVmClusters + /// + /// + /// Operation Id + /// ExadbVmCluster_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-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 GetExadbVmClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetExadbVmClustersAsync(cancellationToken); + } + + /// + /// List ExadbVmCluster resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exadbVmClusters + /// + /// + /// Operation Id + /// ExadbVmCluster_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-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 GetExadbVmClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetExadbVmClusters(cancellationToken); + } + + /// + /// List ExascaleDbStorageVault resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exascaleDbStorageVaults + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-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 GetExascaleDbStorageVaultsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetExascaleDbStorageVaultsAsync(cancellationToken); + } + + /// + /// List ExascaleDbStorageVault resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/exascaleDbStorageVaults + /// + /// + /// Operation Id + /// ExascaleDbStorageVault_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-03-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 GetExascaleDbStorageVaults(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableOracleDatabaseSubscriptionResource(subscriptionResource).GetExascaleDbStorageVaults(cancellationToken); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentCollection.cs new file mode 100644 index 000000000000..8607b6552c92 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentCollection.cs @@ -0,0 +1,402 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// 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 GetFlexComponents method from an instance of . + /// + public partial class FlexComponentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _flexComponentClientDiagnostics; + private readonly FlexComponentsRestOperations _flexComponentRestClient; + private readonly AzureLocation _location; + + /// Initializes a new instance of the class for mocking. + protected FlexComponentCollection() + { + } + + /// 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. + /// The name of the Azure region. + internal FlexComponentCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) + { + _location = location; + _flexComponentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", FlexComponentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FlexComponentResource.ResourceType, out string flexComponentApiVersion); + _flexComponentRestClient = new FlexComponentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, flexComponentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponent_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentCollection.Get"); + scope.Start(); + try + { + var response = await _flexComponentRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), flexComponentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FlexComponentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponent_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentCollection.Get"); + scope.Start(); + try + { + var response = _flexComponentRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), flexComponentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FlexComponentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List FlexComponent resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents + /// + /// + /// Operation Id + /// FlexComponent_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// If provided, filters the results for the given shape. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(SystemShape? shape = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _flexComponentRestClient.CreateListByParentRequest(Id.SubscriptionId, new AzureLocation(_location), shape); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _flexComponentRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location), shape); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FlexComponentResource(Client, FlexComponentData.DeserializeFlexComponentData(e)), _flexComponentClientDiagnostics, Pipeline, "FlexComponentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List FlexComponent resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents + /// + /// + /// Operation Id + /// FlexComponent_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// If provided, filters the results for the given shape. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(SystemShape? shape = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _flexComponentRestClient.CreateListByParentRequest(Id.SubscriptionId, new AzureLocation(_location), shape); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _flexComponentRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location), shape); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FlexComponentResource(Client, FlexComponentData.DeserializeFlexComponentData(e)), _flexComponentClientDiagnostics, Pipeline, "FlexComponentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponent_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentCollection.Exists"); + scope.Start(); + try + { + var response = await _flexComponentRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), flexComponentName, 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}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponent_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentCollection.Exists"); + scope.Start(); + try + { + var response = _flexComponentRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), flexComponentName, 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}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponent_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _flexComponentRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), flexComponentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FlexComponentResource(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}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponent_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the FlexComponent. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _flexComponentRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), flexComponentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FlexComponentResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.Serialization.cs new file mode 100644 index 000000000000..b42120201bca --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class FlexComponentData : 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(FlexComponentData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FlexComponentData 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(FlexComponentData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFlexComponentData(document.RootElement, options); + } + + internal static FlexComponentData DeserializeFlexComponentData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FlexComponentProperties 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 = FlexComponentProperties.DeserializeFlexComponentProperties(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 FlexComponentData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FlexComponentData)} does not support writing '{options.Format}' format."); + } + } + + FlexComponentData 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 DeserializeFlexComponentData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FlexComponentData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.cs new file mode 100644 index 000000000000..a6be89fcc167 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the FlexComponent data model. + /// FlexComponent Resource Definition + /// + public partial class FlexComponentData : 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 FlexComponentData() + { + } + + /// 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 FlexComponentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, FlexComponentProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public FlexComponentProperties Properties { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.Serialization.cs new file mode 100644 index 000000000000..0b685efb8e37 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.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.OracleDatabase +{ + public partial class FlexComponentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FlexComponentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FlexComponentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.cs new file mode 100644 index 000000000000..46f297ae1a02 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/FlexComponentResource.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; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing a FlexComponent 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 GetFlexComponentResource method. + /// Otherwise you can get one from its parent resource using the GetFlexComponent method. + /// + public partial class FlexComponentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The location. + /// The flexComponentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string flexComponentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _flexComponentClientDiagnostics; + private readonly FlexComponentsRestOperations _flexComponentRestClient; + private readonly FlexComponentData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/locations/flexComponents"; + + /// Initializes a new instance of the class for mocking. + protected FlexComponentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FlexComponentResource(ArmClient client, FlexComponentData 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 FlexComponentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _flexComponentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string flexComponentApiVersion); + _flexComponentRestClient = new FlexComponentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, flexComponentApiVersion); +#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 FlexComponentData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponent_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentResource.Get"); + scope.Start(); + try + { + var response = await _flexComponentRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FlexComponentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a FlexComponent + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/flexComponents/{flexComponentName} + /// + /// + /// Operation Id + /// FlexComponent_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _flexComponentClientDiagnostics.CreateScope("FlexComponentResource.Get"); + scope.Start(); + try + { + var response = _flexComponentRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FlexComponentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionCollection.cs new file mode 100644 index 000000000000..9bde4b39f80d --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionCollection.cs @@ -0,0 +1,400 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// 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 GetGiMinorVersions method from an instance of . + /// + public partial class GiMinorVersionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _giMinorVersionClientDiagnostics; + private readonly GiMinorVersionsRestOperations _giMinorVersionRestClient; + + /// Initializes a new instance of the class for mocking. + protected GiMinorVersionCollection() + { + } + + /// 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 GiMinorVersionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _giMinorVersionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", GiMinorVersionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(GiMinorVersionResource.ResourceType, out string giMinorVersionApiVersion); + _giMinorVersionRestClient = new GiMinorVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, giMinorVersionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != GiVersionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, GiVersionResource.ResourceType), nameof(id)); + } + + /// + /// Get a GiMinorVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionCollection.Get"); + scope.Start(); + try + { + var response = await _giMinorVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, giMinorVersionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GiMinorVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a GiMinorVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionCollection.Get"); + scope.Start(); + try + { + var response = _giMinorVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, giMinorVersionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GiMinorVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List GiMinorVersion resources by GiVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions + /// + /// + /// Operation Id + /// GiMinorVersion_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// If provided, filters the results to the set of database versions which are supported for the given shape family. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(ShapeFamily? shapeFamily = null, string zone = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _giMinorVersionRestClient.CreateListByParentRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, shapeFamily, zone); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _giMinorVersionRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, shapeFamily, zone); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GiMinorVersionResource(Client, GiMinorVersionData.DeserializeGiMinorVersionData(e)), _giMinorVersionClientDiagnostics, Pipeline, "GiMinorVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List GiMinorVersion resources by GiVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions + /// + /// + /// Operation Id + /// GiMinorVersion_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// If provided, filters the results to the set of database versions which are supported for the given shape family. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(ShapeFamily? shapeFamily = null, string zone = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _giMinorVersionRestClient.CreateListByParentRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, shapeFamily, zone); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _giMinorVersionRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, shapeFamily, zone); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GiMinorVersionResource(Client, GiMinorVersionData.DeserializeGiMinorVersionData(e)), _giMinorVersionClientDiagnostics, Pipeline, "GiMinorVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionCollection.Exists"); + scope.Start(); + try + { + var response = await _giMinorVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, giMinorVersionName, 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}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionCollection.Exists"); + scope.Start(); + try + { + var response = _giMinorVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, giMinorVersionName, 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}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _giMinorVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, giMinorVersionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GiMinorVersionResource(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}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _giMinorVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, giMinorVersionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GiMinorVersionResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.Serialization.cs new file mode 100644 index 000000000000..e073f2df5ad7 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class GiMinorVersionData : 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(GiMinorVersionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + GiMinorVersionData 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(GiMinorVersionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGiMinorVersionData(document.RootElement, options); + } + + internal static GiMinorVersionData DeserializeGiMinorVersionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + GiMinorVersionProperties 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 = GiMinorVersionProperties.DeserializeGiMinorVersionProperties(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 GiMinorVersionData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GiMinorVersionData)} does not support writing '{options.Format}' format."); + } + } + + GiMinorVersionData 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 DeserializeGiMinorVersionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GiMinorVersionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.cs new file mode 100644 index 000000000000..1caa30341880 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the GiMinorVersion data model. + /// The Oracle Grid Infrastructure (GI) minor version resource definition. + /// + public partial class GiMinorVersionData : 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 GiMinorVersionData() + { + } + + /// 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 GiMinorVersionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, GiMinorVersionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public GiMinorVersionProperties Properties { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.Serialization.cs new file mode 100644 index 000000000000..61d5861b314c --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.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.OracleDatabase +{ + public partial class GiMinorVersionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + GiMinorVersionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + GiMinorVersionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.cs new file mode 100644 index 000000000000..974f94d1908a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiMinorVersionResource.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.OracleDatabase +{ + /// + /// A Class representing a GiMinorVersion 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 GetGiMinorVersionResource method. + /// Otherwise you can get one from its parent resource using the GetGiMinorVersion method. + /// + public partial class GiMinorVersionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The location. + /// The giversionname. + /// The giMinorVersionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string giversionname, string giMinorVersionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _giMinorVersionClientDiagnostics; + private readonly GiMinorVersionsRestOperations _giMinorVersionRestClient; + private readonly GiMinorVersionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/locations/giVersions/giMinorVersions"; + + /// Initializes a new instance of the class for mocking. + protected GiMinorVersionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal GiMinorVersionResource(ArmClient client, GiMinorVersionData 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 GiMinorVersionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _giMinorVersionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string giMinorVersionApiVersion); + _giMinorVersionRestClient = new GiMinorVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, giMinorVersionApiVersion); +#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 GiMinorVersionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a GiMinorVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionResource.Get"); + scope.Start(); + try + { + var response = await _giMinorVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(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 GiMinorVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a GiMinorVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _giMinorVersionClientDiagnostics.CreateScope("GiMinorVersionResource.Get"); + scope.Start(); + try + { + var response = _giMinorVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Parent.Name), Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GiMinorVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionCollection.cs new file mode 100644 index 000000000000..02e8f64ba2a9 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionCollection.cs @@ -0,0 +1,404 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// 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 GetGiVersions method from an instance of . + /// + public partial class GiVersionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _giVersionClientDiagnostics; + private readonly GiVersionsRestOperations _giVersionRestClient; + private readonly AzureLocation _location; + + /// Initializes a new instance of the class for mocking. + protected GiVersionCollection() + { + } + + /// 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. + /// The name of the Azure region. + internal GiVersionCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) + { + _location = location; + _giVersionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", GiVersionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(GiVersionResource.ResourceType, out string giVersionApiVersion); + _giVersionRestClient = new GiVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, giVersionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Get a GiVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname} + /// + /// + /// Operation Id + /// GiVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// GiVersion 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 giversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var scope = _giVersionClientDiagnostics.CreateScope("GiVersionCollection.Get"); + scope.Start(); + try + { + var response = await _giVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), giversionname, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GiVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a GiVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname} + /// + /// + /// Operation Id + /// GiVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// GiVersion name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string giversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var scope = _giVersionClientDiagnostics.CreateScope("GiVersionCollection.Get"); + scope.Start(); + try + { + var response = _giVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), giversionname, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GiVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List GiVersion resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions + /// + /// + /// Operation Id + /// GiVersion_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// If provided, filters the results for the given shape. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(SystemShape? shape = null, string zone = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _giVersionRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location), shape, zone); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _giVersionRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location), shape, zone); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GiVersionResource(Client, GiVersionData.DeserializeGiVersionData(e)), _giVersionClientDiagnostics, Pipeline, "GiVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List GiVersion resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions + /// + /// + /// Operation Id + /// GiVersion_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// If provided, filters the results for the given shape. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(SystemShape? shape = null, string zone = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _giVersionRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location), shape, zone); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _giVersionRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location), shape, zone); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GiVersionResource(Client, GiVersionData.DeserializeGiVersionData(e)), _giVersionClientDiagnostics, Pipeline, "GiVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname} + /// + /// + /// Operation Id + /// GiVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// GiVersion 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 giversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var scope = _giVersionClientDiagnostics.CreateScope("GiVersionCollection.Exists"); + scope.Start(); + try + { + var response = await _giVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), giversionname, 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}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname} + /// + /// + /// Operation Id + /// GiVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// GiVersion name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string giversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var scope = _giVersionClientDiagnostics.CreateScope("GiVersionCollection.Exists"); + scope.Start(); + try + { + var response = _giVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), giversionname, 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}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname} + /// + /// + /// Operation Id + /// GiVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// GiVersion 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 giversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var scope = _giVersionClientDiagnostics.CreateScope("GiVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _giVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), giversionname, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GiVersionResource(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}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname} + /// + /// + /// Operation Id + /// GiVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// GiVersion name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string giversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var scope = _giVersionClientDiagnostics.CreateScope("GiVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _giVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), giversionname, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GiVersionResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionData.Serialization.cs new file mode 100644 index 000000000000..3b3171915497 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class GiVersionData : 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(GiVersionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + GiVersionData 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(GiVersionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGiVersionData(document.RootElement, options); + } + + internal static GiVersionData DeserializeGiVersionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + GiVersionProperties 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 = GiVersionProperties.DeserializeGiVersionProperties(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 GiVersionData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GiVersionData)} does not support writing '{options.Format}' format."); + } + } + + GiVersionData 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 DeserializeGiVersionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GiVersionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionData.cs new file mode 100644 index 000000000000..cf82603ba982 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionData.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; +using Azure.ResourceManager.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the GiVersion data model. + /// GiVersion resource definition + /// + public partial class GiVersionData : 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 GiVersionData() + { + } + + /// 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 GiVersionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, GiVersionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + internal GiVersionProperties Properties { get; } + /// A valid Oracle Grid Infrastructure (GI) software version. + public string GiVersion + { + get => Properties?.Version; + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionResource.Serialization.cs new file mode 100644 index 000000000000..5b613f3e6863 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionResource.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.OracleDatabase +{ + public partial class GiVersionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + GiVersionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + GiVersionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionResource.cs new file mode 100644 index 000000000000..aa5d89b11af4 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/GiVersionResource.cs @@ -0,0 +1,240 @@ +// 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.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing a GiVersion 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 GetGiVersionResource method. + /// Otherwise you can get one from its parent resource using the GetGiVersion method. + /// + public partial class GiVersionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The location. + /// The giversionname. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string giversionname) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _giVersionClientDiagnostics; + private readonly GiVersionsRestOperations _giVersionRestClient; + private readonly GiVersionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/locations/giVersions"; + + /// Initializes a new instance of the class for mocking. + protected GiVersionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal GiVersionResource(ArmClient client, GiVersionData 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 GiVersionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _giVersionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string giVersionApiVersion); + _giVersionRestClient = new GiVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, giVersionApiVersion); +#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 GiVersionData 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 GiMinorVersionResources in the GiVersion. + /// An object representing collection of GiMinorVersionResources and their operations over a GiMinorVersionResource. + public virtual GiMinorVersionCollection GetGiMinorVersions() + { + return GetCachedClient(client => new GiMinorVersionCollection(client, Id)); + } + + /// + /// Get a GiMinorVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetGiMinorVersionAsync(string giMinorVersionName, CancellationToken cancellationToken = default) + { + return await GetGiMinorVersions().GetAsync(giMinorVersionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a GiMinorVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname}/giMinorVersions/{giMinorVersionName} + /// + /// + /// Operation Id + /// GiMinorVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the GiMinorVersion. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetGiMinorVersion(string giMinorVersionName, CancellationToken cancellationToken = default) + { + return GetGiMinorVersions().Get(giMinorVersionName, cancellationToken); + } + + /// + /// Get a GiVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname} + /// + /// + /// Operation Id + /// GiVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _giVersionClientDiagnostics.CreateScope("GiVersionResource.Get"); + scope.Start(); + try + { + var response = await _giVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GiVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a GiVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/giVersions/{giversionname} + /// + /// + /// Operation Id + /// GiVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _giVersionClientDiagnostics.CreateScope("GiVersionResource.Get"); + scope.Start(); + try + { + var response = _giVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GiVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/Argument.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..0f2aed863812 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/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.OracleDatabase +{ + 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..260c1b7f6873 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/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.OracleDatabase +{ + 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/ChangeTrackingList.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..e58de7b0afd8 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/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.OracleDatabase +{ + 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..bd1fcaa5efdf --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,399 @@ +// 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.OracleDatabase +{ + internal static class ModelSerializationExtensions + { + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + 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 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/Optional.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..25502e5b927a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/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.OracleDatabase +{ + 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..2cc0e4da3a2e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/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.OracleDatabase +{ + 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/AutonomousDatabaseBackupOperationSource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/AutonomousDatabaseBackupOperationSource.cs new file mode 100644 index 000000000000..2eec34c29edd --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/AutonomousDatabaseBackupOperationSource.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.OracleDatabase +{ + internal class AutonomousDatabaseBackupOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal AutonomousDatabaseBackupOperationSource(ArmClient client) + { + _client = client; + } + + AutonomousDatabaseBackupResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new AutonomousDatabaseBackupResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new AutonomousDatabaseBackupResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/AutonomousDatabaseOperationSource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/AutonomousDatabaseOperationSource.cs new file mode 100644 index 000000000000..942957d268d5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/AutonomousDatabaseOperationSource.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.OracleDatabase +{ + internal class AutonomousDatabaseOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal AutonomousDatabaseOperationSource(ArmClient client) + { + _client = client; + } + + AutonomousDatabaseResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new AutonomousDatabaseResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new AutonomousDatabaseResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/CloudExadataInfrastructureOperationSource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/CloudExadataInfrastructureOperationSource.cs new file mode 100644 index 000000000000..a00b2445a0a4 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/CloudExadataInfrastructureOperationSource.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.OracleDatabase +{ + internal class CloudExadataInfrastructureOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal CloudExadataInfrastructureOperationSource(ArmClient client) + { + _client = client; + } + + CloudExadataInfrastructureResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new CloudExadataInfrastructureResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new CloudExadataInfrastructureResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/CloudVmClusterOperationSource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/CloudVmClusterOperationSource.cs new file mode 100644 index 000000000000..e230fc680a1d --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/CloudVmClusterOperationSource.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.OracleDatabase +{ + internal class CloudVmClusterOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal CloudVmClusterOperationSource(ArmClient client) + { + _client = client; + } + + CloudVmClusterResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new CloudVmClusterResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new CloudVmClusterResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/DbActionResponseOperationSource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/DbActionResponseOperationSource.cs new file mode 100644 index 000000000000..944a1f2b5d2f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/DbActionResponseOperationSource.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal class DbActionResponseOperationSource : IOperationSource + { + DbActionResponse IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return DbActionResponse.DeserializeDbActionResponse(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return DbActionResponse.DeserializeDbActionResponse(document.RootElement); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/DbNodeOperationSource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/DbNodeOperationSource.cs new file mode 100644 index 000000000000..5dbc4f68d8e0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/DbNodeOperationSource.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.OracleDatabase +{ + internal class DbNodeOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DbNodeOperationSource(ArmClient client) + { + _client = client; + } + + DbNodeResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new DbNodeResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new DbNodeResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExadbVmClusterOperationSource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExadbVmClusterOperationSource.cs new file mode 100644 index 000000000000..b0970ce98262 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExadbVmClusterOperationSource.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.OracleDatabase +{ + internal class ExadbVmClusterOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ExadbVmClusterOperationSource(ArmClient client) + { + _client = client; + } + + ExadbVmClusterResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new ExadbVmClusterResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new ExadbVmClusterResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExascaleDbStorageVaultOperationSource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExascaleDbStorageVaultOperationSource.cs new file mode 100644 index 000000000000..f3b81b509d41 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/ExascaleDbStorageVaultOperationSource.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.OracleDatabase +{ + internal class ExascaleDbStorageVaultOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ExascaleDbStorageVaultOperationSource(ArmClient client) + { + _client = client; + } + + ExascaleDbStorageVaultResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new ExascaleDbStorageVaultResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new ExascaleDbStorageVaultResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/OracleDatabaseArmOperation.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/OracleDatabaseArmOperation.cs new file mode 100644 index 000000000000..7da3e72ee1fd --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/OracleDatabaseArmOperation.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.OracleDatabase +{ +#pragma warning disable SA1649 // File name should match first type name + internal class OracleDatabaseArmOperation : 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 OracleDatabaseArmOperation for mocking. + protected OracleDatabaseArmOperation() + { + } + + internal OracleDatabaseArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal OracleDatabaseArmOperation(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, "OracleDatabaseArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/OracleDatabaseArmOperationOfT.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/OracleDatabaseArmOperationOfT.cs new file mode 100644 index 000000000000..018393a6b241 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/OracleDatabaseArmOperationOfT.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.OracleDatabase +{ +#pragma warning disable SA1649 // File name should match first type name + internal class OracleDatabaseArmOperation : 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 OracleDatabaseArmOperation for mocking. + protected OracleDatabaseArmOperation() + { + } + + internal OracleDatabaseArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal OracleDatabaseArmOperation(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, "OracleDatabaseArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/OracleSubscriptionOperationSource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/OracleSubscriptionOperationSource.cs new file mode 100644 index 000000000000..2e78e263d083 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/OracleSubscriptionOperationSource.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.OracleDatabase +{ + internal class OracleSubscriptionOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal OracleSubscriptionOperationSource(ArmClient client) + { + _client = client; + } + + OracleSubscriptionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new OracleSubscriptionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new OracleSubscriptionResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/VirtualNetworkAddressOperationSource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/VirtualNetworkAddressOperationSource.cs new file mode 100644 index 000000000000..f5340e9aea58 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/LongRunningOperation/VirtualNetworkAddressOperationSource.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.OracleDatabase +{ + internal class VirtualNetworkAddressOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal VirtualNetworkAddressOperationSource(ArmClient client) + { + _client = client; + } + + VirtualNetworkAddressResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new VirtualNetworkAddressResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new VirtualNetworkAddressResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddRemoveDbNode.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddRemoveDbNode.Serialization.cs new file mode 100644 index 000000000000..1a880500442b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddRemoveDbNode.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + public partial class AddRemoveDbNode : 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(AddRemoveDbNode)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("dbServers"u8); + writer.WriteStartArray(); + foreach (var item in DbServers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AddRemoveDbNode 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(AddRemoveDbNode)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAddRemoveDbNode(document.RootElement, options); + } + + internal static AddRemoveDbNode DeserializeAddRemoveDbNode(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList dbServers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dbServers"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dbServers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AddRemoveDbNode(dbServers, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AddRemoveDbNode)} does not support writing '{options.Format}' format."); + } + } + + AddRemoveDbNode 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 DeserializeAddRemoveDbNode(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AddRemoveDbNode)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddRemoveDbNode.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddRemoveDbNode.cs new file mode 100644 index 000000000000..8d1583c39ca2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddRemoveDbNode.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 System.Linq; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Add/Remove (Virtual Machine) DbNode model. + public partial class AddRemoveDbNode + { + /// + /// 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 . + /// Db servers ocids. + /// is null. + public AddRemoveDbNode(IEnumerable dbServers) + { + Argument.AssertNotNull(dbServers, nameof(dbServers)); + + DbServers = dbServers.ToList(); + } + + /// Initializes a new instance of . + /// Db servers ocids. + /// Keeps track of any properties unknown to the library. + internal AddRemoveDbNode(IList dbServers, IDictionary serializedAdditionalRawData) + { + DbServers = dbServers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AddRemoveDbNode() + { + } + + /// Db servers ocids. + public IList DbServers { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddSubscriptionOperationState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddSubscriptionOperationState.cs new file mode 100644 index 000000000000..29255876381b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AddSubscriptionOperationState.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.OracleDatabase.Models +{ + /// Add Subscription Operation state enum. + public readonly partial struct AddSubscriptionOperationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AddSubscriptionOperationState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string UpdatingValue = "Updating"; + private const string FailedValue = "Failed"; + + /// Succeeded - State when Add Subscription operation succeeded. + public static AddSubscriptionOperationState Succeeded { get; } = new AddSubscriptionOperationState(SucceededValue); + /// Updating - State when Add Subscription operation is being Updated. + public static AddSubscriptionOperationState Updating { get; } = new AddSubscriptionOperationState(UpdatingValue); + /// Failed - State when Add Subscription operation failed. + public static AddSubscriptionOperationState Failed { get; } = new AddSubscriptionOperationState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(AddSubscriptionOperationState left, AddSubscriptionOperationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AddSubscriptionOperationState left, AddSubscriptionOperationState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AddSubscriptionOperationState(string value) => new AddSubscriptionOperationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AddSubscriptionOperationState other && Equals(other); + /// + public bool Equals(AddSubscriptionOperationState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AllConnectionStringType.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AllConnectionStringType.Serialization.cs new file mode 100644 index 000000000000..10bfc9b5fe2d --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AllConnectionStringType.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.OracleDatabase.Models +{ + public partial class AllConnectionStringType : 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(AllConnectionStringType)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(High)) + { + writer.WritePropertyName("high"u8); + writer.WriteStringValue(High); + } + if (Optional.IsDefined(Low)) + { + writer.WritePropertyName("low"u8); + writer.WriteStringValue(Low); + } + if (Optional.IsDefined(Medium)) + { + writer.WritePropertyName("medium"u8); + writer.WriteStringValue(Medium); + } + 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 + } + } + } + + AllConnectionStringType 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(AllConnectionStringType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAllConnectionStringType(document.RootElement, options); + } + + internal static AllConnectionStringType DeserializeAllConnectionStringType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string high = default; + string low = default; + string medium = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("high"u8)) + { + high = property.Value.GetString(); + continue; + } + if (property.NameEquals("low"u8)) + { + low = property.Value.GetString(); + continue; + } + if (property.NameEquals("medium"u8)) + { + medium = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AllConnectionStringType(high, low, medium, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AllConnectionStringType)} does not support writing '{options.Format}' format."); + } + } + + AllConnectionStringType 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 DeserializeAllConnectionStringType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AllConnectionStringType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AllConnectionStringType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AllConnectionStringType.cs new file mode 100644 index 000000000000..226dd8dd507b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AllConnectionStringType.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.OracleDatabase.Models +{ + /// The connection string profile to allow clients to group, filter and select connection string values based on structured metadata. + public partial class AllConnectionStringType + { + /// + /// 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 AllConnectionStringType() + { + } + + /// Initializes a new instance of . + /// The High database service provides the highest level of resources to each SQL statement resulting in the highest performance, but supports the fewest number of concurrent SQL statements. + /// The Low database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. + /// The Medium database service provides a lower level of resources to each SQL statement potentially resulting a lower level of performance, but supports more concurrent SQL statements. + /// Keeps track of any properties unknown to the library. + internal AllConnectionStringType(string high, string low, string medium, IDictionary serializedAdditionalRawData) + { + High = high; + Low = low; + Medium = medium; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The High database service provides the highest level of resources to each SQL statement resulting in the highest performance, but supports the fewest number of concurrent SQL statements. + public string High { get; } + /// The Low database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. + public string Low { get; } + /// The Medium database service provides a lower level of resources to each SQL statement potentially resulting a lower level of performance, but supports more concurrent SQL statements. + public string Medium { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ApexDetailsType.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ApexDetailsType.Serialization.cs new file mode 100644 index 000000000000..76216f19eddb --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ApexDetailsType.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + public partial class ApexDetailsType : 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(ApexDetailsType)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ApexVersion)) + { + writer.WritePropertyName("apexVersion"u8); + writer.WriteStringValue(ApexVersion); + } + if (Optional.IsDefined(OrdsVersion)) + { + writer.WritePropertyName("ordsVersion"u8); + writer.WriteStringValue(OrdsVersion); + } + 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 + } + } + } + + ApexDetailsType 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(ApexDetailsType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApexDetailsType(document.RootElement, options); + } + + internal static ApexDetailsType DeserializeApexDetailsType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string apexVersion = default; + string ordsVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("apexVersion"u8)) + { + apexVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("ordsVersion"u8)) + { + ordsVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ApexDetailsType(apexVersion, ordsVersion, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ApexDetailsType)} does not support writing '{options.Format}' format."); + } + } + + ApexDetailsType 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 DeserializeApexDetailsType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApexDetailsType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupUpdateProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ApexDetailsType.cs similarity index 69% rename from sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupUpdateProperties.cs rename to sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ApexDetailsType.cs index 3505e610363b..9e346ee2f4d5 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupUpdateProperties.cs +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ApexDetailsType.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.OracleDatabase.Models { - /// The updatable properties of the AutonomousDatabaseBackup. - internal partial class AutonomousDatabaseBackupUpdateProperties + /// Information about Oracle APEX Application Development. + public partial class ApexDetailsType { /// /// Keeps track of any properties unknown to the library. @@ -45,21 +45,25 @@ internal partial class AutonomousDatabaseBackupUpdateProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public AutonomousDatabaseBackupUpdateProperties() + /// Initializes a new instance of . + internal ApexDetailsType() { } - /// Initializes a new instance of . - /// Retention period, in days, for long-term backups. + /// Initializes a new instance of . + /// The Oracle APEX Application Development version. + /// The Oracle REST Data Services (ORDS) version. /// Keeps track of any properties unknown to the library. - internal AutonomousDatabaseBackupUpdateProperties(int? retentionPeriodInDays, IDictionary serializedAdditionalRawData) + internal ApexDetailsType(string apexVersion, string ordsVersion, IDictionary serializedAdditionalRawData) { - RetentionPeriodInDays = retentionPeriodInDays; + ApexVersion = apexVersion; + OrdsVersion = ordsVersion; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Retention period, in days, for long-term backups. - public int? RetentionPeriodInDays { get; set; } + /// The Oracle APEX Application Development version. + public string ApexVersion { get; } + /// The Oracle REST Data Services (ORDS) version. + public string OrdsVersion { get; } } } diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupLifecycleState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupLifecycleState.cs new file mode 100644 index 000000000000..2c0eacc9663d --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupLifecycleState.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Autonomous database backup lifecycle state enum. + public readonly partial struct AutonomousDatabaseBackupLifecycleState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutonomousDatabaseBackupLifecycleState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreatingValue = "Creating"; + private const string ActiveValue = "Active"; + private const string DeletingValue = "Deleting"; + private const string FailedValue = "Failed"; + private const string UpdatingValue = "Updating"; + + /// AutonomousDatabase backup is creating. + public static AutonomousDatabaseBackupLifecycleState Creating { get; } = new AutonomousDatabaseBackupLifecycleState(CreatingValue); + /// AutonomousDatabase backup is active. + public static AutonomousDatabaseBackupLifecycleState Active { get; } = new AutonomousDatabaseBackupLifecycleState(ActiveValue); + /// AutonomousDatabase backup is deleting. + public static AutonomousDatabaseBackupLifecycleState Deleting { get; } = new AutonomousDatabaseBackupLifecycleState(DeletingValue); + /// AutonomousDatabase backup is failed. + public static AutonomousDatabaseBackupLifecycleState Failed { get; } = new AutonomousDatabaseBackupLifecycleState(FailedValue); + /// AutonomousDatabase backup is updating. + public static AutonomousDatabaseBackupLifecycleState Updating { get; } = new AutonomousDatabaseBackupLifecycleState(UpdatingValue); + /// Determines if two values are the same. + public static bool operator ==(AutonomousDatabaseBackupLifecycleState left, AutonomousDatabaseBackupLifecycleState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutonomousDatabaseBackupLifecycleState left, AutonomousDatabaseBackupLifecycleState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutonomousDatabaseBackupLifecycleState(string value) => new AutonomousDatabaseBackupLifecycleState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutonomousDatabaseBackupLifecycleState other && Equals(other); + /// + public bool Equals(AutonomousDatabaseBackupLifecycleState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupListResult.Serialization.cs new file mode 100644 index 000000000000..749c1ff80590 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupListResult.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.OracleDatabase.Models +{ + internal partial class AutonomousDatabaseBackupListResult : 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(AutonomousDatabaseBackupListResult)} 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 + } + } + } + + AutonomousDatabaseBackupListResult 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(AutonomousDatabaseBackupListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseBackupListResult(document.RootElement, options); + } + + internal static AutonomousDatabaseBackupListResult DeserializeAutonomousDatabaseBackupListResult(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(AutonomousDatabaseBackupData.DeserializeAutonomousDatabaseBackupData(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 AutonomousDatabaseBackupListResult(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); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseBackupListResult)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseBackupListResult 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 DeserializeAutonomousDatabaseBackupListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseBackupListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupListResult.cs new file mode 100644 index 000000000000..547c14aa9da2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupListResult.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.OracleDatabase.Models +{ + /// The response of a AutonomousDatabaseBackup list operation. + internal partial class AutonomousDatabaseBackupListResult + { + /// + /// 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 AutonomousDatabaseBackup items on this page. + /// is null. + internal AutonomousDatabaseBackupListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AutonomousDatabaseBackup items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AutonomousDatabaseBackupListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDatabaseBackupListResult() + { + } + + /// The AutonomousDatabaseBackup items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupProperties.Serialization.cs new file mode 100644 index 000000000000..5343f788f66e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupProperties.Serialization.cs @@ -0,0 +1,347 @@ +// 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.OracleDatabase.Models +{ + public partial class AutonomousDatabaseBackupProperties : 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(AutonomousDatabaseBackupProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(AutonomousDatabaseOcid)) + { + writer.WritePropertyName("autonomousDatabaseOcid"u8); + writer.WriteStringValue(AutonomousDatabaseOcid); + } + if (options.Format != "W" && Optional.IsDefined(DatabaseSizeInTbs)) + { + writer.WritePropertyName("databaseSizeInTbs"u8); + writer.WriteNumberValue(DatabaseSizeInTbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(DbVersion)) + { + writer.WritePropertyName("dbVersion"u8); + writer.WriteStringValue(DbVersion); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(Ocid)) + { + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + } + if (options.Format != "W" && Optional.IsDefined(IsAutomatic)) + { + writer.WritePropertyName("isAutomatic"u8); + writer.WriteBooleanValue(IsAutomatic.Value); + } + if (options.Format != "W" && Optional.IsDefined(IsRestorable)) + { + writer.WritePropertyName("isRestorable"u8); + writer.WriteBooleanValue(IsRestorable.Value); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleDetails)) + { + writer.WritePropertyName("lifecycleDetails"u8); + writer.WriteStringValue(LifecycleDetails); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleState)) + { + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.Value.ToString()); + } + if (Optional.IsDefined(RetentionPeriodInDays)) + { + writer.WritePropertyName("retentionPeriodInDays"u8); + writer.WriteNumberValue(RetentionPeriodInDays.Value); + } + if (options.Format != "W" && Optional.IsDefined(SizeInTbs)) + { + writer.WritePropertyName("sizeInTbs"u8); + writer.WriteNumberValue(SizeInTbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(TimeAvailableTil)) + { + writer.WritePropertyName("timeAvailableTil"u8); + writer.WriteStringValue(TimeAvailableTil.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(TimeStarted)) + { + writer.WritePropertyName("timeStarted"u8); + writer.WriteStringValue(TimeStarted); + } + if (options.Format != "W" && Optional.IsDefined(TimeEnded)) + { + writer.WritePropertyName("timeEnded"u8); + writer.WriteStringValue(TimeEnded); + } + if (options.Format != "W" && Optional.IsDefined(BackupType)) + { + writer.WritePropertyName("backupType"u8); + writer.WriteStringValue(BackupType.Value.ToString()); + } + 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 + } + } + } + + AutonomousDatabaseBackupProperties 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(AutonomousDatabaseBackupProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseBackupProperties(document.RootElement, options); + } + + internal static AutonomousDatabaseBackupProperties DeserializeAutonomousDatabaseBackupProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string autonomousDatabaseOcid = default; + double? databaseSizeInTbs = default; + string dbVersion = default; + string displayName = default; + string ocid = default; + bool? isAutomatic = default; + bool? isRestorable = default; + string lifecycleDetails = default; + AutonomousDatabaseBackupLifecycleState? lifecycleState = default; + int? retentionPeriodInDays = default; + double? sizeInTbs = default; + DateTimeOffset? timeAvailableTil = default; + string timeStarted = default; + string timeEnded = default; + AutonomousDatabaseBackupType? backupType = default; + AzureResourceProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("autonomousDatabaseOcid"u8)) + { + autonomousDatabaseOcid = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("dbVersion"u8)) + { + dbVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("isAutomatic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutomatic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isRestorable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isRestorable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new AutonomousDatabaseBackupLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("retentionPeriodInDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retentionPeriodInDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("timeAvailableTil"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeAvailableTil = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeStarted"u8)) + { + timeStarted = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeEnded"u8)) + { + timeEnded = property.Value.GetString(); + continue; + } + if (property.NameEquals("backupType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backupType = new AutonomousDatabaseBackupType(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureResourceProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutonomousDatabaseBackupProperties( + autonomousDatabaseOcid, + databaseSizeInTbs, + dbVersion, + displayName, + ocid, + isAutomatic, + isRestorable, + lifecycleDetails, + lifecycleState, + retentionPeriodInDays, + sizeInTbs, + timeAvailableTil, + timeStarted, + timeEnded, + backupType, + 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); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseBackupProperties)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseBackupProperties 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 DeserializeAutonomousDatabaseBackupProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseBackupProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupProperties.cs new file mode 100644 index 000000000000..62273feddba7 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupProperties.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// AutonomousDatabaseBackup resource model. + public partial class AutonomousDatabaseBackupProperties + { + /// + /// 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 AutonomousDatabaseBackupProperties() + { + } + + /// Initializes a new instance of . + /// The OCID of the Autonomous Database. + /// The size of the database in terabytes at the time the backup was taken. + /// A valid Oracle Database version for Autonomous Database. + /// The user-friendly name for the backup. The name does not have to be unique. + /// The OCID of the Autonomous Database backup. + /// Indicates whether the backup is user-initiated or automatic. + /// Indicates whether the backup can be used to restore the associated Autonomous Database. + /// Additional information about the current lifecycle state. + /// The current state of the backup. + /// Retention period, in days. + /// The backup size in terabytes (TB). + /// Timestamp until when the backup will be available. + /// The date and time the backup started. + /// The date and time the backup completed. + /// The type of backup. + /// Azure resource provisioning state. + /// Keeps track of any properties unknown to the library. + internal AutonomousDatabaseBackupProperties(string autonomousDatabaseOcid, double? databaseSizeInTbs, string dbVersion, string displayName, string ocid, bool? isAutomatic, bool? isRestorable, string lifecycleDetails, AutonomousDatabaseBackupLifecycleState? lifecycleState, int? retentionPeriodInDays, double? sizeInTbs, DateTimeOffset? timeAvailableTil, string timeStarted, string timeEnded, AutonomousDatabaseBackupType? backupType, AzureResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + AutonomousDatabaseOcid = autonomousDatabaseOcid; + DatabaseSizeInTbs = databaseSizeInTbs; + DbVersion = dbVersion; + DisplayName = displayName; + Ocid = ocid; + IsAutomatic = isAutomatic; + IsRestorable = isRestorable; + LifecycleDetails = lifecycleDetails; + LifecycleState = lifecycleState; + RetentionPeriodInDays = retentionPeriodInDays; + SizeInTbs = sizeInTbs; + TimeAvailableTil = timeAvailableTil; + TimeStarted = timeStarted; + TimeEnded = timeEnded; + BackupType = backupType; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The OCID of the Autonomous Database. + public string AutonomousDatabaseOcid { get; } + /// The size of the database in terabytes at the time the backup was taken. + public double? DatabaseSizeInTbs { get; } + /// A valid Oracle Database version for Autonomous Database. + public string DbVersion { get; } + /// The user-friendly name for the backup. The name does not have to be unique. + public string DisplayName { get; set; } + /// The OCID of the Autonomous Database backup. + public string Ocid { get; } + /// Indicates whether the backup is user-initiated or automatic. + public bool? IsAutomatic { get; } + /// Indicates whether the backup can be used to restore the associated Autonomous Database. + public bool? IsRestorable { get; } + /// Additional information about the current lifecycle state. + public string LifecycleDetails { get; } + /// The current state of the backup. + public AutonomousDatabaseBackupLifecycleState? LifecycleState { get; } + /// Retention period, in days. + public int? RetentionPeriodInDays { get; set; } + /// The backup size in terabytes (TB). + public double? SizeInTbs { get; } + /// Timestamp until when the backup will be available. + public DateTimeOffset? TimeAvailableTil { get; } + /// The date and time the backup started. + public string TimeStarted { get; } + /// The date and time the backup completed. + public string TimeEnded { get; } + /// The type of backup. + public AutonomousDatabaseBackupType? BackupType { get; } + /// Azure resource provisioning state. + public AzureResourceProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupType.cs new file mode 100644 index 000000000000..10cd36d2315e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupType.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.OracleDatabase.Models +{ + /// Autonomous database backup type enum. + public readonly partial struct AutonomousDatabaseBackupType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutonomousDatabaseBackupType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string IncrementalValue = "Incremental"; + private const string FullValue = "Full"; + private const string LongTermValue = "LongTerm"; + + /// Incremental backup. + public static AutonomousDatabaseBackupType Incremental { get; } = new AutonomousDatabaseBackupType(IncrementalValue); + /// Full backup. + public static AutonomousDatabaseBackupType Full { get; } = new AutonomousDatabaseBackupType(FullValue); + /// LongTerm backup. + public static AutonomousDatabaseBackupType LongTerm { get; } = new AutonomousDatabaseBackupType(LongTermValue); + /// Determines if two values are the same. + public static bool operator ==(AutonomousDatabaseBackupType left, AutonomousDatabaseBackupType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutonomousDatabaseBackupType left, AutonomousDatabaseBackupType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutonomousDatabaseBackupType(string value) => new AutonomousDatabaseBackupType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutonomousDatabaseBackupType other && Equals(other); + /// + public bool Equals(AutonomousDatabaseBackupType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.Serialization.cs new file mode 100644 index 000000000000..39b61a4751ee --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.Serialization.cs @@ -0,0 +1,530 @@ +// 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.OracleDatabase.Models +{ + [PersistableModelProxy(typeof(UnknownAutonomousDatabaseBaseProperties))] + public partial class AutonomousDatabaseBaseProperties : 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(AutonomousDatabaseBaseProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AdminPassword)) + { + writer.WritePropertyName("adminPassword"u8); + writer.WriteStringValue(AdminPassword); + } + writer.WritePropertyName("dataBaseType"u8); + writer.WriteStringValue(DataBaseType.ToString()); + if (Optional.IsDefined(AutonomousMaintenanceScheduleType)) + { + writer.WritePropertyName("autonomousMaintenanceScheduleType"u8); + writer.WriteStringValue(AutonomousMaintenanceScheduleType.Value.ToString()); + } + if (Optional.IsDefined(CharacterSet)) + { + writer.WritePropertyName("characterSet"u8); + writer.WriteStringValue(CharacterSet); + } + if (Optional.IsDefined(ComputeCount)) + { + writer.WritePropertyName("computeCount"u8); + writer.WriteNumberValue(ComputeCount.Value); + } + if (Optional.IsDefined(ComputeModel)) + { + writer.WritePropertyName("computeModel"u8); + writer.WriteStringValue(ComputeModel.Value.ToString()); + } + if (Optional.IsDefined(CpuCoreCount)) + { + writer.WritePropertyName("cpuCoreCount"u8); + writer.WriteNumberValue(CpuCoreCount.Value); + } + if (Optional.IsCollectionDefined(CustomerContacts)) + { + writer.WritePropertyName("customerContacts"u8); + writer.WriteStartArray(); + foreach (var item in CustomerContacts) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DataStorageSizeInTbs)) + { + writer.WritePropertyName("dataStorageSizeInTbs"u8); + writer.WriteNumberValue(DataStorageSizeInTbs.Value); + } + if (Optional.IsDefined(DataStorageSizeInGbs)) + { + writer.WritePropertyName("dataStorageSizeInGbs"u8); + writer.WriteNumberValue(DataStorageSizeInGbs.Value); + } + if (Optional.IsDefined(DbVersion)) + { + writer.WritePropertyName("dbVersion"u8); + writer.WriteStringValue(DbVersion); + } + if (Optional.IsDefined(DbWorkload)) + { + writer.WritePropertyName("dbWorkload"u8); + writer.WriteStringValue(DbWorkload.Value.ToString()); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(IsAutoScalingEnabled)) + { + writer.WritePropertyName("isAutoScalingEnabled"u8); + writer.WriteBooleanValue(IsAutoScalingEnabled.Value); + } + if (Optional.IsDefined(IsAutoScalingForStorageEnabled)) + { + writer.WritePropertyName("isAutoScalingForStorageEnabled"u8); + writer.WriteBooleanValue(IsAutoScalingForStorageEnabled.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(PeerDbIds)) + { + writer.WritePropertyName("peerDbIds"u8); + writer.WriteStartArray(); + foreach (var item in PeerDbIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PeerDbId)) + { + writer.WritePropertyName("peerDbId"u8); + writer.WriteStringValue(PeerDbId); + } + if (Optional.IsDefined(IsLocalDataGuardEnabled)) + { + writer.WritePropertyName("isLocalDataGuardEnabled"u8); + writer.WriteBooleanValue(IsLocalDataGuardEnabled.Value); + } + if (options.Format != "W" && Optional.IsDefined(IsRemoteDataGuardEnabled)) + { + writer.WritePropertyName("isRemoteDataGuardEnabled"u8); + writer.WriteBooleanValue(IsRemoteDataGuardEnabled.Value); + } + if (options.Format != "W" && Optional.IsDefined(LocalDisasterRecoveryType)) + { + writer.WritePropertyName("localDisasterRecoveryType"u8); + writer.WriteStringValue(LocalDisasterRecoveryType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TimeDisasterRecoveryRoleChanged)) + { + writer.WritePropertyName("timeDisasterRecoveryRoleChanged"u8); + writer.WriteStringValue(TimeDisasterRecoveryRoleChanged.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(RemoteDisasterRecoveryConfiguration)) + { + writer.WritePropertyName("remoteDisasterRecoveryConfiguration"u8); + writer.WriteObjectValue(RemoteDisasterRecoveryConfiguration, options); + } + if (options.Format != "W" && Optional.IsDefined(LocalStandbyDb)) + { + writer.WritePropertyName("localStandbyDb"u8); + writer.WriteObjectValue(LocalStandbyDb, options); + } + if (options.Format != "W" && Optional.IsDefined(FailedDataRecoveryInSeconds)) + { + writer.WritePropertyName("failedDataRecoveryInSeconds"u8); + writer.WriteNumberValue(FailedDataRecoveryInSeconds.Value); + } + if (Optional.IsDefined(IsMtlsConnectionRequired)) + { + writer.WritePropertyName("isMtlsConnectionRequired"u8); + writer.WriteBooleanValue(IsMtlsConnectionRequired.Value); + } + if (Optional.IsDefined(IsPreviewVersionWithServiceTermsAccepted)) + { + writer.WritePropertyName("isPreviewVersionWithServiceTermsAccepted"u8); + writer.WriteBooleanValue(IsPreviewVersionWithServiceTermsAccepted.Value); + } + if (Optional.IsDefined(LicenseModel)) + { + writer.WritePropertyName("licenseModel"u8); + writer.WriteStringValue(LicenseModel.Value.ToString()); + } + if (Optional.IsDefined(NcharacterSet)) + { + writer.WritePropertyName("ncharacterSet"u8); + writer.WriteStringValue(NcharacterSet); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleDetails)) + { + writer.WritePropertyName("lifecycleDetails"u8); + writer.WriteStringValue(LifecycleDetails); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleState)) + { + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.Value.ToString()); + } + if (Optional.IsDefined(ScheduledOperations)) + { + writer.WritePropertyName("scheduledOperations"u8); + writer.WriteObjectValue(ScheduledOperations, options); + } + if (Optional.IsDefined(PrivateEndpointIP)) + { + writer.WritePropertyName("privateEndpointIp"u8); + writer.WriteStringValue(PrivateEndpointIP); + } + if (Optional.IsDefined(PrivateEndpointLabel)) + { + writer.WritePropertyName("privateEndpointLabel"u8); + writer.WriteStringValue(PrivateEndpointLabel); + } + if (options.Format != "W" && Optional.IsDefined(OciUri)) + { + writer.WritePropertyName("ociUrl"u8); + writer.WriteStringValue(OciUri); + } + if (Optional.IsDefined(SubnetId)) + { + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + } + if (Optional.IsDefined(VnetId)) + { + writer.WritePropertyName("vnetId"u8); + writer.WriteStringValue(VnetId); + } + if (options.Format != "W" && Optional.IsDefined(TimeCreated)) + { + writer.WritePropertyName("timeCreated"u8); + writer.WriteStringValue(TimeCreated.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(TimeMaintenanceBegin)) + { + writer.WritePropertyName("timeMaintenanceBegin"u8); + writer.WriteStringValue(TimeMaintenanceBegin.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(TimeMaintenanceEnd)) + { + writer.WritePropertyName("timeMaintenanceEnd"u8); + writer.WriteStringValue(TimeMaintenanceEnd.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ActualUsedDataStorageSizeInTbs)) + { + writer.WritePropertyName("actualUsedDataStorageSizeInTbs"u8); + writer.WriteNumberValue(ActualUsedDataStorageSizeInTbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(AllocatedStorageSizeInTbs)) + { + writer.WritePropertyName("allocatedStorageSizeInTbs"u8); + writer.WriteNumberValue(AllocatedStorageSizeInTbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(ApexDetails)) + { + writer.WritePropertyName("apexDetails"u8); + writer.WriteObjectValue(ApexDetails, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AvailableUpgradeVersions)) + { + writer.WritePropertyName("availableUpgradeVersions"u8); + writer.WriteStartArray(); + foreach (var item in AvailableUpgradeVersions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ConnectionStrings)) + { + writer.WritePropertyName("connectionStrings"u8); + writer.WriteObjectValue(ConnectionStrings, options); + } + if (options.Format != "W" && Optional.IsDefined(ConnectionUrls)) + { + writer.WritePropertyName("connectionUrls"u8); + writer.WriteObjectValue(ConnectionUrls, options); + } + if (options.Format != "W" && Optional.IsDefined(DataSafeStatus)) + { + writer.WritePropertyName("dataSafeStatus"u8); + writer.WriteStringValue(DataSafeStatus.Value.ToString()); + } + if (Optional.IsDefined(DatabaseEdition)) + { + writer.WritePropertyName("databaseEdition"u8); + writer.WriteStringValue(DatabaseEdition.Value.ToString()); + } + if (Optional.IsDefined(AutonomousDatabaseId)) + { + writer.WritePropertyName("autonomousDatabaseId"u8); + writer.WriteStringValue(AutonomousDatabaseId); + } + if (options.Format != "W" && Optional.IsDefined(InMemoryAreaInGbs)) + { + writer.WritePropertyName("inMemoryAreaInGbs"u8); + writer.WriteNumberValue(InMemoryAreaInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(NextLongTermBackupTimeStamp)) + { + writer.WritePropertyName("nextLongTermBackupTimeStamp"u8); + writer.WriteStringValue(NextLongTermBackupTimeStamp.Value, "O"); + } + if (Optional.IsDefined(LongTermBackupSchedule)) + { + writer.WritePropertyName("longTermBackupSchedule"u8); + writer.WriteObjectValue(LongTermBackupSchedule, options); + } + if (options.Format != "W" && Optional.IsDefined(IsPreview)) + { + writer.WritePropertyName("isPreview"u8); + writer.WriteBooleanValue(IsPreview.Value); + } + if (Optional.IsDefined(LocalAdgAutoFailoverMaxDataLossLimit)) + { + writer.WritePropertyName("localAdgAutoFailoverMaxDataLossLimit"u8); + writer.WriteNumberValue(LocalAdgAutoFailoverMaxDataLossLimit.Value); + } + if (options.Format != "W" && Optional.IsDefined(MemoryPerOracleComputeUnitInGbs)) + { + writer.WritePropertyName("memoryPerOracleComputeUnitInGbs"u8); + writer.WriteNumberValue(MemoryPerOracleComputeUnitInGbs.Value); + } + if (Optional.IsDefined(OpenMode)) + { + writer.WritePropertyName("openMode"u8); + writer.WriteStringValue(OpenMode.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(OperationsInsightsStatus)) + { + writer.WritePropertyName("operationsInsightsStatus"u8); + writer.WriteStringValue(OperationsInsightsStatus.Value.ToString()); + } + if (Optional.IsDefined(PermissionLevel)) + { + writer.WritePropertyName("permissionLevel"u8); + writer.WriteStringValue(PermissionLevel.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(PrivateEndpoint)) + { + writer.WritePropertyName("privateEndpoint"u8); + writer.WriteStringValue(PrivateEndpoint); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ProvisionableCpus)) + { + writer.WritePropertyName("provisionableCpus"u8); + writer.WriteStartArray(); + foreach (var item in ProvisionableCpus) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Role)) + { + writer.WritePropertyName("role"u8); + writer.WriteStringValue(Role.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ServiceConsoleUri)) + { + writer.WritePropertyName("serviceConsoleUrl"u8); + writer.WriteStringValue(ServiceConsoleUri); + } + if (options.Format != "W" && Optional.IsDefined(SqlWebDeveloperUri)) + { + writer.WritePropertyName("sqlWebDeveloperUrl"u8); + writer.WriteStringValue(SqlWebDeveloperUri); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SupportedRegionsToCloneTo)) + { + writer.WritePropertyName("supportedRegionsToCloneTo"u8); + writer.WriteStartArray(); + foreach (var item in SupportedRegionsToCloneTo) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(TimeDataGuardRoleChanged)) + { + writer.WritePropertyName("timeDataGuardRoleChanged"u8); + writer.WriteStringValue(TimeDataGuardRoleChanged); + } + if (options.Format != "W" && Optional.IsDefined(TimeDeletionOfFreeAutonomousDatabase)) + { + writer.WritePropertyName("timeDeletionOfFreeAutonomousDatabase"u8); + writer.WriteStringValue(TimeDeletionOfFreeAutonomousDatabase); + } + if (options.Format != "W" && Optional.IsDefined(TimeLocalDataGuardEnabled)) + { + writer.WritePropertyName("timeLocalDataGuardEnabled"u8); + writer.WriteStringValue(TimeLocalDataGuardEnabled); + } + if (options.Format != "W" && Optional.IsDefined(TimeOfLastFailover)) + { + writer.WritePropertyName("timeOfLastFailover"u8); + writer.WriteStringValue(TimeOfLastFailover); + } + if (options.Format != "W" && Optional.IsDefined(TimeOfLastRefresh)) + { + writer.WritePropertyName("timeOfLastRefresh"u8); + writer.WriteStringValue(TimeOfLastRefresh); + } + if (options.Format != "W" && Optional.IsDefined(TimeOfLastRefreshPoint)) + { + writer.WritePropertyName("timeOfLastRefreshPoint"u8); + writer.WriteStringValue(TimeOfLastRefreshPoint); + } + if (options.Format != "W" && Optional.IsDefined(TimeOfLastSwitchover)) + { + writer.WritePropertyName("timeOfLastSwitchover"u8); + writer.WriteStringValue(TimeOfLastSwitchover); + } + if (options.Format != "W" && Optional.IsDefined(TimeReclamationOfFreeAutonomousDatabase)) + { + writer.WritePropertyName("timeReclamationOfFreeAutonomousDatabase"u8); + writer.WriteStringValue(TimeReclamationOfFreeAutonomousDatabase); + } + if (options.Format != "W" && Optional.IsDefined(UsedDataStorageSizeInGbs)) + { + writer.WritePropertyName("usedDataStorageSizeInGbs"u8); + writer.WriteNumberValue(UsedDataStorageSizeInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(UsedDataStorageSizeInTbs)) + { + writer.WritePropertyName("usedDataStorageSizeInTbs"u8); + writer.WriteNumberValue(UsedDataStorageSizeInTbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(Ocid)) + { + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + } + if (Optional.IsDefined(BackupRetentionPeriodInDays)) + { + writer.WritePropertyName("backupRetentionPeriodInDays"u8); + writer.WriteNumberValue(BackupRetentionPeriodInDays.Value); + } + if (Optional.IsCollectionDefined(WhitelistedIPs)) + { + writer.WritePropertyName("whitelistedIps"u8); + writer.WriteStartArray(); + foreach (var item in WhitelistedIPs) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AutonomousDatabaseBaseProperties 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(AutonomousDatabaseBaseProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseBaseProperties(document.RootElement, options); + } + + internal static AutonomousDatabaseBaseProperties DeserializeAutonomousDatabaseBaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("dataBaseType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Clone": return AutonomousDatabaseCloneProperties.DeserializeAutonomousDatabaseCloneProperties(element, options); + case "CloneFromBackupTimestamp": return AutonomousDatabaseFromBackupTimestampProperties.DeserializeAutonomousDatabaseFromBackupTimestampProperties(element, options); + case "CrossRegionDisasterRecovery": return AutonomousDatabaseCrossRegionDisasterRecoveryProperties.DeserializeAutonomousDatabaseCrossRegionDisasterRecoveryProperties(element, options); + case "Regular": return AutonomousDatabaseProperties.DeserializeAutonomousDatabaseProperties(element, options); + } + } + return UnknownAutonomousDatabaseBaseProperties.DeserializeUnknownAutonomousDatabaseBaseProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseBaseProperties)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseBaseProperties 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 DeserializeAutonomousDatabaseBaseProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseBaseProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.cs new file mode 100644 index 000000000000..7a5d8952962e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBaseProperties.cs @@ -0,0 +1,380 @@ +// 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.OracleDatabase.Models +{ + /// + /// Autonomous Database base resource model. + /// 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 AutonomousDatabaseBaseProperties + { + /// + /// 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 AutonomousDatabaseBaseProperties() + { + CustomerContacts = new ChangeTrackingList(); + PeerDbIds = new ChangeTrackingList(); + AvailableUpgradeVersions = new ChangeTrackingList(); + ProvisionableCpus = new ChangeTrackingList(); + SupportedRegionsToCloneTo = new ChangeTrackingList(); + WhitelistedIPs = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Admin password. + /// Database type to be created. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// Keeps track of any properties unknown to the library. + internal AutonomousDatabaseBaseProperties(string adminPassword, DataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, ComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, WorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDbIds, string peerDbId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, DateTimeOffset? timeDisasterRecoveryRoleChanged, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration, AutonomousDatabaseStandbySummary localStandbyDb, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, LicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, AzureResourceProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, string ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? timeCreated, DateTimeOffset? timeMaintenanceBegin, DateTimeOffset? timeMaintenanceEnd, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, ApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, ConnectionStringType connectionStrings, ConnectionUrlType connectionUrls, DataSafeStatusType? dataSafeStatus, DatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupTimeStamp, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, OpenModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, PermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, RoleType? role, string serviceConsoleUri, string sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, string timeDataGuardRoleChanged, string timeDeletionOfFreeAutonomousDatabase, string timeLocalDataGuardEnabled, string timeOfLastFailover, string timeOfLastRefresh, string timeOfLastRefreshPoint, string timeOfLastSwitchover, string timeReclamationOfFreeAutonomousDatabase, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, string ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData) + { + AdminPassword = adminPassword; + DataBaseType = dataBaseType; + AutonomousMaintenanceScheduleType = autonomousMaintenanceScheduleType; + CharacterSet = characterSet; + ComputeCount = computeCount; + ComputeModel = computeModel; + CpuCoreCount = cpuCoreCount; + CustomerContacts = customerContacts; + DataStorageSizeInTbs = dataStorageSizeInTbs; + DataStorageSizeInGbs = dataStorageSizeInGbs; + DbVersion = dbVersion; + DbWorkload = dbWorkload; + DisplayName = displayName; + IsAutoScalingEnabled = isAutoScalingEnabled; + IsAutoScalingForStorageEnabled = isAutoScalingForStorageEnabled; + PeerDbIds = peerDbIds; + PeerDbId = peerDbId; + IsLocalDataGuardEnabled = isLocalDataGuardEnabled; + IsRemoteDataGuardEnabled = isRemoteDataGuardEnabled; + LocalDisasterRecoveryType = localDisasterRecoveryType; + TimeDisasterRecoveryRoleChanged = timeDisasterRecoveryRoleChanged; + RemoteDisasterRecoveryConfiguration = remoteDisasterRecoveryConfiguration; + LocalStandbyDb = localStandbyDb; + FailedDataRecoveryInSeconds = failedDataRecoveryInSeconds; + IsMtlsConnectionRequired = isMtlsConnectionRequired; + IsPreviewVersionWithServiceTermsAccepted = isPreviewVersionWithServiceTermsAccepted; + LicenseModel = licenseModel; + NcharacterSet = ncharacterSet; + LifecycleDetails = lifecycleDetails; + ProvisioningState = provisioningState; + LifecycleState = lifecycleState; + ScheduledOperations = scheduledOperations; + PrivateEndpointIP = privateEndpointIP; + PrivateEndpointLabel = privateEndpointLabel; + OciUri = ociUri; + SubnetId = subnetId; + VnetId = vnetId; + TimeCreated = timeCreated; + TimeMaintenanceBegin = timeMaintenanceBegin; + TimeMaintenanceEnd = timeMaintenanceEnd; + ActualUsedDataStorageSizeInTbs = actualUsedDataStorageSizeInTbs; + AllocatedStorageSizeInTbs = allocatedStorageSizeInTbs; + ApexDetails = apexDetails; + AvailableUpgradeVersions = availableUpgradeVersions; + ConnectionStrings = connectionStrings; + ConnectionUrls = connectionUrls; + DataSafeStatus = dataSafeStatus; + DatabaseEdition = databaseEdition; + AutonomousDatabaseId = autonomousDatabaseId; + InMemoryAreaInGbs = inMemoryAreaInGbs; + NextLongTermBackupTimeStamp = nextLongTermBackupTimeStamp; + LongTermBackupSchedule = longTermBackupSchedule; + IsPreview = isPreview; + LocalAdgAutoFailoverMaxDataLossLimit = localAdgAutoFailoverMaxDataLossLimit; + MemoryPerOracleComputeUnitInGbs = memoryPerOracleComputeUnitInGbs; + OpenMode = openMode; + OperationsInsightsStatus = operationsInsightsStatus; + PermissionLevel = permissionLevel; + PrivateEndpoint = privateEndpoint; + ProvisionableCpus = provisionableCpus; + Role = role; + ServiceConsoleUri = serviceConsoleUri; + SqlWebDeveloperUri = sqlWebDeveloperUri; + SupportedRegionsToCloneTo = supportedRegionsToCloneTo; + TimeDataGuardRoleChanged = timeDataGuardRoleChanged; + TimeDeletionOfFreeAutonomousDatabase = timeDeletionOfFreeAutonomousDatabase; + TimeLocalDataGuardEnabled = timeLocalDataGuardEnabled; + TimeOfLastFailover = timeOfLastFailover; + TimeOfLastRefresh = timeOfLastRefresh; + TimeOfLastRefreshPoint = timeOfLastRefreshPoint; + TimeOfLastSwitchover = timeOfLastSwitchover; + TimeReclamationOfFreeAutonomousDatabase = timeReclamationOfFreeAutonomousDatabase; + UsedDataStorageSizeInGbs = usedDataStorageSizeInGbs; + UsedDataStorageSizeInTbs = usedDataStorageSizeInTbs; + Ocid = ocid; + BackupRetentionPeriodInDays = backupRetentionPeriodInDays; + WhitelistedIPs = whitelistedIPs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Admin password. + public string AdminPassword { get; set; } + /// Database type to be created. + internal DataBaseType DataBaseType { get; set; } + /// The maintenance schedule type of the Autonomous Database Serverless. + public AutonomousMaintenanceScheduleType? AutonomousMaintenanceScheduleType { get; set; } + /// The character set for the autonomous database. + public string CharacterSet { get; set; } + /// The compute amount (CPUs) available to the database. + public float? ComputeCount { get; set; } + /// The compute model of the Autonomous Database. + public ComputeModel? ComputeModel { get; set; } + /// The number of CPU cores to be made available to the database. + public int? CpuCoreCount { get; set; } + /// Customer Contacts. + public IList CustomerContacts { get; } + /// The quantity of data in the database, in terabytes. + public int? DataStorageSizeInTbs { get; set; } + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + public int? DataStorageSizeInGbs { get; set; } + /// A valid Oracle Database version for Autonomous Database. + public string DbVersion { get; set; } + /// The Autonomous Database workload type. + public WorkloadType? DbWorkload { get; set; } + /// The user-friendly name for the Autonomous Database. + public string DisplayName { get; set; } + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + public bool? IsAutoScalingEnabled { get; set; } + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + public bool? IsAutoScalingForStorageEnabled { get; set; } + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + public IReadOnlyList PeerDbIds { get; } + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + public string PeerDbId { get; set; } + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + public bool? IsLocalDataGuardEnabled { get; set; } + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + public bool? IsRemoteDataGuardEnabled { get; } + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + public DisasterRecoveryType? LocalDisasterRecoveryType { get; } + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + public DateTimeOffset? TimeDisasterRecoveryRoleChanged { get; } + /// Indicates remote disaster recovery configuration. + public DisasterRecoveryConfigurationDetails RemoteDisasterRecoveryConfiguration { get; } + /// Local Autonomous Disaster Recovery standby database details. + public AutonomousDatabaseStandbySummary LocalStandbyDb { get; } + /// Indicates the number of seconds of data loss for a Data Guard failover. + public int? FailedDataRecoveryInSeconds { get; } + /// Specifies if the Autonomous Database requires mTLS connections. + public bool? IsMtlsConnectionRequired { get; set; } + /// Specifies if the Autonomous Database preview version is being provisioned. + public bool? IsPreviewVersionWithServiceTermsAccepted { get; set; } + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + public LicenseModel? LicenseModel { get; set; } + /// The character set for the Autonomous Database. + public string NcharacterSet { get; set; } + /// Additional information about the current lifecycle state. + public string LifecycleDetails { get; } + /// Azure resource provisioning state. + public AzureResourceProvisioningState? ProvisioningState { get; } + /// Views lifecycleState. + public AutonomousDatabaseLifecycleState? LifecycleState { get; } + /// The list of scheduled operations. + public ScheduledOperationsType ScheduledOperations { get; set; } + /// The private endpoint Ip address for the resource. + public string PrivateEndpointIP { get; set; } + /// The resource's private endpoint label. + public string PrivateEndpointLabel { get; set; } + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + public string OciUri { get; } + /// Client subnet. + public ResourceIdentifier SubnetId { get; set; } + /// VNET for network connectivity. + public ResourceIdentifier VnetId { get; set; } + /// The date and time that the database was created. + public DateTimeOffset? TimeCreated { get; } + /// The date and time when maintenance will begin. + public DateTimeOffset? TimeMaintenanceBegin { get; } + /// The date and time when maintenance will end. + public DateTimeOffset? TimeMaintenanceEnd { get; } + /// The current amount of storage in use for user and system data, in terabytes (TB). + public double? ActualUsedDataStorageSizeInTbs { get; } + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + public double? AllocatedStorageSizeInTbs { get; } + /// Information about Oracle APEX Application Development. + public ApexDetailsType ApexDetails { get; } + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + public IReadOnlyList AvailableUpgradeVersions { get; } + /// The connection string used to connect to the Autonomous Database. + public ConnectionStringType ConnectionStrings { get; } + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + public ConnectionUrlType ConnectionUrls { get; } + /// Status of the Data Safe registration for this Autonomous Database. + public DataSafeStatusType? DataSafeStatus { get; } + /// The Oracle Database Edition that applies to the Autonomous databases. + public DatabaseEditionType? DatabaseEdition { get; set; } + /// Autonomous Database ID. + public ResourceIdentifier AutonomousDatabaseId { get; set; } + /// The area assigned to In-Memory tables in Autonomous Database. + public int? InMemoryAreaInGbs { get; } + /// The date and time when the next long-term backup would be created. + public DateTimeOffset? NextLongTermBackupTimeStamp { get; } + /// Details for the long-term backup schedule. + public LongTermBackUpScheduleDetails LongTermBackupSchedule { get; set; } + /// Indicates if the Autonomous Database version is a preview version. + public bool? IsPreview { get; } + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + public int? LocalAdgAutoFailoverMaxDataLossLimit { get; set; } + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + public int? MemoryPerOracleComputeUnitInGbs { get; } + /// Indicates the Autonomous Database mode. + public OpenModeType? OpenMode { get; set; } + /// Status of Operations Insights for this Autonomous Database. + public OperationsInsightsStatusType? OperationsInsightsStatus { get; } + /// The Autonomous Database permission level. + public PermissionLevelType? PermissionLevel { get; set; } + /// The private endpoint for the resource. + public string PrivateEndpoint { get; } + /// An array of CPU values that an Autonomous Database can be scaled to. + public IReadOnlyList ProvisionableCpus { get; } + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + public RoleType? Role { get; set; } + /// The URL of the Service Console for the Autonomous Database. + public string ServiceConsoleUri { get; } + /// The SQL Web Developer URL for the Oracle Autonomous Database. + public string SqlWebDeveloperUri { get; } + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + public IReadOnlyList SupportedRegionsToCloneTo { get; } + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + public string TimeDataGuardRoleChanged { get; } + /// The date and time the Always Free database will be automatically deleted because of inactivity. + public string TimeDeletionOfFreeAutonomousDatabase { get; } + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + public string TimeLocalDataGuardEnabled { get; } + /// The timestamp of the last failover operation. + public string TimeOfLastFailover { get; } + /// The date and time when last refresh happened. + public string TimeOfLastRefresh { get; } + /// The refresh point timestamp (UTC). + public string TimeOfLastRefreshPoint { get; } + /// The timestamp of the last switchover operation for the Autonomous Database. + public string TimeOfLastSwitchover { get; } + /// The date and time the Always Free database will be stopped because of inactivity. + public string TimeReclamationOfFreeAutonomousDatabase { get; } + /// The storage space consumed by Autonomous Database in GBs. + public int? UsedDataStorageSizeInGbs { get; } + /// The amount of storage that has been used, in terabytes. + public int? UsedDataStorageSizeInTbs { get; } + /// Database ocid. + public string Ocid { get; } + /// Retention period, in days, for long-term backups. + public int? BackupRetentionPeriodInDays { get; set; } + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + public IList WhitelistedIPs { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetListResult.Serialization.cs new file mode 100644 index 000000000000..fcb3ab655e2a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetListResult.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.OracleDatabase.Models +{ + internal partial class AutonomousDatabaseCharacterSetListResult : 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(AutonomousDatabaseCharacterSetListResult)} 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 + } + } + } + + AutonomousDatabaseCharacterSetListResult 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(AutonomousDatabaseCharacterSetListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseCharacterSetListResult(document.RootElement, options); + } + + internal static AutonomousDatabaseCharacterSetListResult DeserializeAutonomousDatabaseCharacterSetListResult(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(AutonomousDatabaseCharacterSetData.DeserializeAutonomousDatabaseCharacterSetData(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 AutonomousDatabaseCharacterSetListResult(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); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseCharacterSetListResult)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseCharacterSetListResult 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 DeserializeAutonomousDatabaseCharacterSetListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseCharacterSetListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetListResult.cs new file mode 100644 index 000000000000..e11926615f79 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetListResult.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.OracleDatabase.Models +{ + /// The response of a AutonomousDatabaseCharacterSet list operation. + internal partial class AutonomousDatabaseCharacterSetListResult + { + /// + /// 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 AutonomousDatabaseCharacterSet items on this page. + /// is null. + internal AutonomousDatabaseCharacterSetListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AutonomousDatabaseCharacterSet items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AutonomousDatabaseCharacterSetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDatabaseCharacterSetListResult() + { + } + + /// The AutonomousDatabaseCharacterSet items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupUpdateProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.Serialization.cs similarity index 64% rename from sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupUpdateProperties.Serialization.cs rename to sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.Serialization.cs index 7a071bd45d1a..b91fa0e5f4ed 100644 --- a/sdk/oracle/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseBackupUpdateProperties.Serialization.cs +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.OracleDatabase.Models { - internal partial class AutonomousDatabaseBackupUpdateProperties : IUtf8JsonSerializable, IJsonModel + internal partial class AutonomousDatabaseCharacterSetProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,17 +28,14 @@ void IJsonModel.Write(Utf8JsonWriter w /// 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AutonomousDatabaseBackupUpdateProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AutonomousDatabaseCharacterSetProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(RetentionPeriodInDays)) - { - writer.WritePropertyName("retentionPeriodInDays"u8); - writer.WriteNumberValue(RetentionPeriodInDays.Value); - } + writer.WritePropertyName("characterSet"u8); + writer.WriteStringValue(CharacterSet); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -56,19 +53,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - AutonomousDatabaseBackupUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AutonomousDatabaseCharacterSetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(AutonomousDatabaseBackupUpdateProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AutonomousDatabaseCharacterSetProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeAutonomousDatabaseBackupUpdateProperties(document.RootElement, options); + return DeserializeAutonomousDatabaseCharacterSetProperties(document.RootElement, options); } - internal static AutonomousDatabaseBackupUpdateProperties DeserializeAutonomousDatabaseBackupUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static AutonomousDatabaseCharacterSetProperties DeserializeAutonomousDatabaseCharacterSetProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,18 +73,14 @@ internal static AutonomousDatabaseBackupUpdateProperties DeserializeAutonomousDa { return null; } - int? retentionPeriodInDays = default; + string characterSet = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("retentionPeriodInDays"u8)) + if (property.NameEquals("characterSet"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - retentionPeriodInDays = property.Value.GetInt32(); + characterSet = property.Value.GetString(); continue; } if (options.Format != "W") @@ -96,38 +89,38 @@ internal static AutonomousDatabaseBackupUpdateProperties DeserializeAutonomousDa } } serializedAdditionalRawData = rawDataDictionary; - return new AutonomousDatabaseBackupUpdateProperties(retentionPeriodInDays, serializedAdditionalRawData); + return new AutonomousDatabaseCharacterSetProperties(characterSet, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(AutonomousDatabaseBackupUpdateProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AutonomousDatabaseCharacterSetProperties)} does not support writing '{options.Format}' format."); } } - AutonomousDatabaseBackupUpdateProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AutonomousDatabaseCharacterSetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeAutonomousDatabaseBackupUpdateProperties(document.RootElement, options); + return DeserializeAutonomousDatabaseCharacterSetProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(AutonomousDatabaseBackupUpdateProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AutonomousDatabaseCharacterSetProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.cs new file mode 100644 index 000000000000..3ab343d37b9a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.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.OracleDatabase.Models +{ + /// AutonomousDatabaseCharacterSet resource model. + internal partial class AutonomousDatabaseCharacterSetProperties + { + /// + /// 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 Oracle Autonomous Database supported character sets. + /// is null. + internal AutonomousDatabaseCharacterSetProperties(string characterSet) + { + Argument.AssertNotNull(characterSet, nameof(characterSet)); + + CharacterSet = characterSet; + } + + /// Initializes a new instance of . + /// The Oracle Autonomous Database supported character sets. + /// Keeps track of any properties unknown to the library. + internal AutonomousDatabaseCharacterSetProperties(string characterSet, IDictionary serializedAdditionalRawData) + { + CharacterSet = characterSet; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDatabaseCharacterSetProperties() + { + } + + /// The Oracle Autonomous Database supported character sets. + public string CharacterSet { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.Serialization.cs new file mode 100644 index 000000000000..5a22d7bddd63 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.Serialization.cs @@ -0,0 +1,1000 @@ +// 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.OracleDatabase.Models +{ + public partial class AutonomousDatabaseCloneProperties : 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(AutonomousDatabaseCloneProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source.Value.ToString()); + } + writer.WritePropertyName("sourceId"u8); + writer.WriteStringValue(SourceId); + writer.WritePropertyName("cloneType"u8); + writer.WriteStringValue(CloneType.ToString()); + if (options.Format != "W" && Optional.IsDefined(IsReconnectCloneEnabled)) + { + writer.WritePropertyName("isReconnectCloneEnabled"u8); + writer.WriteBooleanValue(IsReconnectCloneEnabled.Value); + } + if (options.Format != "W" && Optional.IsDefined(IsRefreshableClone)) + { + writer.WritePropertyName("isRefreshableClone"u8); + writer.WriteBooleanValue(IsRefreshableClone.Value); + } + if (Optional.IsDefined(RefreshableModel)) + { + writer.WritePropertyName("refreshableModel"u8); + writer.WriteStringValue(RefreshableModel.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(RefreshableStatus)) + { + writer.WritePropertyName("refreshableStatus"u8); + writer.WriteStringValue(RefreshableStatus.Value.ToString()); + } + if (Optional.IsDefined(TimeUntilReconnectCloneEnabled)) + { + writer.WritePropertyName("timeUntilReconnectCloneEnabled"u8); + writer.WriteStringValue(TimeUntilReconnectCloneEnabled); + } + } + + AutonomousDatabaseCloneProperties 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(AutonomousDatabaseCloneProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseCloneProperties(document.RootElement, options); + } + + internal static AutonomousDatabaseCloneProperties DeserializeAutonomousDatabaseCloneProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SourceType? source = default; + ResourceIdentifier sourceId = default; + CloneType cloneType = default; + bool? isReconnectCloneEnabled = default; + bool? isRefreshableClone = default; + RefreshableModelType? refreshableModel = default; + RefreshableStatusType? refreshableStatus = default; + string timeUntilReconnectCloneEnabled = default; + string adminPassword = default; + DataBaseType dataBaseType = default; + AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = default; + string characterSet = default; + float? computeCount = default; + ComputeModel? computeModel = default; + int? cpuCoreCount = default; + IList customerContacts = default; + int? dataStorageSizeInTbs = default; + int? dataStorageSizeInGbs = default; + string dbVersion = default; + WorkloadType? dbWorkload = default; + string displayName = default; + bool? isAutoScalingEnabled = default; + bool? isAutoScalingForStorageEnabled = default; + IReadOnlyList peerDbIds = default; + string peerDbId = default; + bool? isLocalDataGuardEnabled = default; + bool? isRemoteDataGuardEnabled = default; + DisasterRecoveryType? localDisasterRecoveryType = default; + DateTimeOffset? timeDisasterRecoveryRoleChanged = default; + DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = default; + AutonomousDatabaseStandbySummary localStandbyDb = default; + int? failedDataRecoveryInSeconds = default; + bool? isMtlsConnectionRequired = default; + bool? isPreviewVersionWithServiceTermsAccepted = default; + LicenseModel? licenseModel = default; + string ncharacterSet = default; + string lifecycleDetails = default; + AzureResourceProvisioningState? provisioningState = default; + AutonomousDatabaseLifecycleState? lifecycleState = default; + ScheduledOperationsType scheduledOperations = default; + string privateEndpointIP = default; + string privateEndpointLabel = default; + string ociUrl = default; + ResourceIdentifier subnetId = default; + ResourceIdentifier vnetId = default; + DateTimeOffset? timeCreated = default; + DateTimeOffset? timeMaintenanceBegin = default; + DateTimeOffset? timeMaintenanceEnd = default; + double? actualUsedDataStorageSizeInTbs = default; + double? allocatedStorageSizeInTbs = default; + ApexDetailsType apexDetails = default; + IReadOnlyList availableUpgradeVersions = default; + ConnectionStringType connectionStrings = default; + ConnectionUrlType connectionUrls = default; + DataSafeStatusType? dataSafeStatus = default; + DatabaseEditionType? databaseEdition = default; + ResourceIdentifier autonomousDatabaseId = default; + int? inMemoryAreaInGbs = default; + DateTimeOffset? nextLongTermBackupTimeStamp = default; + LongTermBackUpScheduleDetails longTermBackupSchedule = default; + bool? isPreview = default; + int? localAdgAutoFailoverMaxDataLossLimit = default; + int? memoryPerOracleComputeUnitInGbs = default; + OpenModeType? openMode = default; + OperationsInsightsStatusType? operationsInsightsStatus = default; + PermissionLevelType? permissionLevel = default; + string privateEndpoint = default; + IReadOnlyList provisionableCpus = default; + RoleType? role = default; + string serviceConsoleUrl = default; + string sqlWebDeveloperUrl = default; + IReadOnlyList supportedRegionsToCloneTo = default; + string timeDataGuardRoleChanged = default; + string timeDeletionOfFreeAutonomousDatabase = default; + string timeLocalDataGuardEnabled = default; + string timeOfLastFailover = default; + string timeOfLastRefresh = default; + string timeOfLastRefreshPoint = default; + string timeOfLastSwitchover = default; + string timeReclamationOfFreeAutonomousDatabase = default; + int? usedDataStorageSizeInGbs = default; + int? usedDataStorageSizeInTbs = default; + string ocid = default; + int? backupRetentionPeriodInDays = default; + IList whitelistedIPs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + source = new SourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceId"u8)) + { + sourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("cloneType"u8)) + { + cloneType = new CloneType(property.Value.GetString()); + continue; + } + if (property.NameEquals("isReconnectCloneEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isReconnectCloneEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isRefreshableClone"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isRefreshableClone = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("refreshableModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + refreshableModel = new RefreshableModelType(property.Value.GetString()); + continue; + } + if (property.NameEquals("refreshableStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + refreshableStatus = new RefreshableStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeUntilReconnectCloneEnabled"u8)) + { + timeUntilReconnectCloneEnabled = property.Value.GetString(); + continue; + } + if (property.NameEquals("adminPassword"u8)) + { + adminPassword = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataBaseType"u8)) + { + dataBaseType = new DataBaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autonomousMaintenanceScheduleType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousMaintenanceScheduleType = new AutonomousMaintenanceScheduleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("characterSet"u8)) + { + characterSet = property.Value.GetString(); + continue; + } + if (property.NameEquals("computeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeCount = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new ComputeModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("cpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("customerContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CustomerContact.DeserializeCustomerContact(item, options)); + } + customerContacts = array; + continue; + } + if (property.NameEquals("dataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dbVersion"u8)) + { + dbVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("dbWorkload"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbWorkload = new WorkloadType(property.Value.GetString()); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isAutoScalingEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isAutoScalingForStorageEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingForStorageEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("peerDbIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + peerDbIds = array; + continue; + } + if (property.NameEquals("peerDbId"u8)) + { + peerDbId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isLocalDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isLocalDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isRemoteDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isRemoteDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("localDisasterRecoveryType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localDisasterRecoveryType = new DisasterRecoveryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeDisasterRecoveryRoleChanged"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeDisasterRecoveryRoleChanged = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("remoteDisasterRecoveryConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remoteDisasterRecoveryConfiguration = DisasterRecoveryConfigurationDetails.DeserializeDisasterRecoveryConfigurationDetails(property.Value, options); + continue; + } + if (property.NameEquals("localStandbyDb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localStandbyDb = AutonomousDatabaseStandbySummary.DeserializeAutonomousDatabaseStandbySummary(property.Value, options); + continue; + } + if (property.NameEquals("failedDataRecoveryInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failedDataRecoveryInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isMtlsConnectionRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMtlsConnectionRequired = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isPreviewVersionWithServiceTermsAccepted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPreviewVersionWithServiceTermsAccepted = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("licenseModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + licenseModel = new LicenseModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("ncharacterSet"u8)) + { + ncharacterSet = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new AutonomousDatabaseLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("scheduledOperations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledOperations = ScheduledOperationsType.DeserializeScheduledOperationsType(property.Value, options); + continue; + } + if (property.NameEquals("privateEndpointIp"u8)) + { + privateEndpointIP = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateEndpointLabel"u8)) + { + privateEndpointLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("ociUrl"u8)) + { + ociUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceBegin"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceBegin = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceEnd"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceEnd = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("actualUsedDataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + actualUsedDataStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("allocatedStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocatedStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("apexDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + apexDetails = ApexDetailsType.DeserializeApexDetailsType(property.Value, options); + continue; + } + if (property.NameEquals("availableUpgradeVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableUpgradeVersions = array; + continue; + } + if (property.NameEquals("connectionStrings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionStrings = ConnectionStringType.DeserializeConnectionStringType(property.Value, options); + continue; + } + if (property.NameEquals("connectionUrls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionUrls = ConnectionUrlType.DeserializeConnectionUrlType(property.Value, options); + continue; + } + if (property.NameEquals("dataSafeStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataSafeStatus = new DataSafeStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseEdition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseEdition = new DatabaseEditionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autonomousDatabaseId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousDatabaseId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("inMemoryAreaInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inMemoryAreaInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nextLongTermBackupTimeStamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLongTermBackupTimeStamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("longTermBackupSchedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + longTermBackupSchedule = LongTermBackUpScheduleDetails.DeserializeLongTermBackUpScheduleDetails(property.Value, options); + continue; + } + if (property.NameEquals("isPreview"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPreview = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("localAdgAutoFailoverMaxDataLossLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localAdgAutoFailoverMaxDataLossLimit = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("memoryPerOracleComputeUnitInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memoryPerOracleComputeUnitInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("openMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + openMode = new OpenModeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("operationsInsightsStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operationsInsightsStatus = new OperationsInsightsStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("permissionLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + permissionLevel = new PermissionLevelType(property.Value.GetString()); + continue; + } + if (property.NameEquals("privateEndpoint"u8)) + { + privateEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisionableCpus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + provisionableCpus = array; + continue; + } + if (property.NameEquals("role"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + role = new RoleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceConsoleUrl"u8)) + { + serviceConsoleUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("sqlWebDeveloperUrl"u8)) + { + sqlWebDeveloperUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("supportedRegionsToCloneTo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + supportedRegionsToCloneTo = array; + continue; + } + if (property.NameEquals("timeDataGuardRoleChanged"u8)) + { + timeDataGuardRoleChanged = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeDeletionOfFreeAutonomousDatabase"u8)) + { + timeDeletionOfFreeAutonomousDatabase = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeLocalDataGuardEnabled"u8)) + { + timeLocalDataGuardEnabled = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastFailover"u8)) + { + timeOfLastFailover = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastRefresh"u8)) + { + timeOfLastRefresh = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastRefreshPoint"u8)) + { + timeOfLastRefreshPoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastSwitchover"u8)) + { + timeOfLastSwitchover = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeReclamationOfFreeAutonomousDatabase"u8)) + { + timeReclamationOfFreeAutonomousDatabase = property.Value.GetString(); + continue; + } + if (property.NameEquals("usedDataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedDataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("usedDataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedDataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("backupRetentionPeriodInDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backupRetentionPeriodInDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("whitelistedIps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + whitelistedIPs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutonomousDatabaseCloneProperties( + adminPassword, + dataBaseType, + autonomousMaintenanceScheduleType, + characterSet, + computeCount, + computeModel, + cpuCoreCount, + customerContacts ?? new ChangeTrackingList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + dbVersion, + dbWorkload, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDbIds ?? new ChangeTrackingList(), + peerDbId, + isLocalDataGuardEnabled, + isRemoteDataGuardEnabled, + localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, + localStandbyDb, + failedDataRecoveryInSeconds, + isMtlsConnectionRequired, + isPreviewVersionWithServiceTermsAccepted, + licenseModel, + ncharacterSet, + lifecycleDetails, + provisioningState, + lifecycleState, + scheduledOperations, + privateEndpointIP, + privateEndpointLabel, + ociUrl, + subnetId, + vnetId, + timeCreated, + timeMaintenanceBegin, + timeMaintenanceEnd, + actualUsedDataStorageSizeInTbs, + allocatedStorageSizeInTbs, + apexDetails, + availableUpgradeVersions ?? new ChangeTrackingList(), + connectionStrings, + connectionUrls, + dataSafeStatus, + databaseEdition, + autonomousDatabaseId, + inMemoryAreaInGbs, + nextLongTermBackupTimeStamp, + longTermBackupSchedule, + isPreview, + localAdgAutoFailoverMaxDataLossLimit, + memoryPerOracleComputeUnitInGbs, + openMode, + operationsInsightsStatus, + permissionLevel, + privateEndpoint, + provisionableCpus ?? new ChangeTrackingList(), + role, + serviceConsoleUrl, + sqlWebDeveloperUrl, + supportedRegionsToCloneTo ?? new ChangeTrackingList(), + timeDataGuardRoleChanged, + timeDeletionOfFreeAutonomousDatabase, + timeLocalDataGuardEnabled, + timeOfLastFailover, + timeOfLastRefresh, + timeOfLastRefreshPoint, + timeOfLastSwitchover, + timeReclamationOfFreeAutonomousDatabase, + usedDataStorageSizeInGbs, + usedDataStorageSizeInTbs, + ocid, + backupRetentionPeriodInDays, + whitelistedIPs ?? new ChangeTrackingList(), + serializedAdditionalRawData, + source, + sourceId, + cloneType, + isReconnectCloneEnabled, + isRefreshableClone, + refreshableModel, + refreshableStatus, + timeUntilReconnectCloneEnabled); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseCloneProperties)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseCloneProperties 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 DeserializeAutonomousDatabaseCloneProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseCloneProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.cs new file mode 100644 index 000000000000..98cc26b3b887 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCloneProperties.cs @@ -0,0 +1,152 @@ +// 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.OracleDatabase.Models +{ + /// Autonomous Database clone resource model. + public partial class AutonomousDatabaseCloneProperties : AutonomousDatabaseBaseProperties + { + /// Initializes a new instance of . + /// The Azure resource ID of the Autonomous Database that was cloned to create the current Autonomous Database. + /// The Autonomous Database clone type. + /// is null. + public AutonomousDatabaseCloneProperties(ResourceIdentifier sourceId, CloneType cloneType) + { + Argument.AssertNotNull(sourceId, nameof(sourceId)); + + SourceId = sourceId; + CloneType = cloneType; + DataBaseType = DataBaseType.Clone; + } + + /// Initializes a new instance of . + /// Admin password. + /// Database type to be created. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// Keeps track of any properties unknown to the library. + /// The source of the database. + /// The Azure resource ID of the Autonomous Database that was cloned to create the current Autonomous Database. + /// The Autonomous Database clone type. + /// Indicates if the refreshable clone can be reconnected to its source database. + /// Indicates if the Autonomous Database is a refreshable clone. + /// The refresh mode of the clone. + /// The refresh status of the clone. + /// The time and date as an RFC3339 formatted string, e.g., 2022-01-01T12:00:00.000Z, to set the limit for a refreshable clone to be reconnected to its source database. + internal AutonomousDatabaseCloneProperties(string adminPassword, DataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, ComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, WorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDbIds, string peerDbId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, DateTimeOffset? timeDisasterRecoveryRoleChanged, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration, AutonomousDatabaseStandbySummary localStandbyDb, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, LicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, AzureResourceProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, string ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? timeCreated, DateTimeOffset? timeMaintenanceBegin, DateTimeOffset? timeMaintenanceEnd, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, ApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, ConnectionStringType connectionStrings, ConnectionUrlType connectionUrls, DataSafeStatusType? dataSafeStatus, DatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupTimeStamp, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, OpenModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, PermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, RoleType? role, string serviceConsoleUri, string sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, string timeDataGuardRoleChanged, string timeDeletionOfFreeAutonomousDatabase, string timeLocalDataGuardEnabled, string timeOfLastFailover, string timeOfLastRefresh, string timeOfLastRefreshPoint, string timeOfLastSwitchover, string timeReclamationOfFreeAutonomousDatabase, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, string ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData, SourceType? source, ResourceIdentifier sourceId, CloneType cloneType, bool? isReconnectCloneEnabled, bool? isRefreshableClone, RefreshableModelType? refreshableModel, RefreshableStatusType? refreshableStatus, string timeUntilReconnectCloneEnabled) : base(adminPassword, dataBaseType, autonomousMaintenanceScheduleType, characterSet, computeCount, computeModel, cpuCoreCount, customerContacts, dataStorageSizeInTbs, dataStorageSizeInGbs, dbVersion, dbWorkload, displayName, isAutoScalingEnabled, isAutoScalingForStorageEnabled, peerDbIds, peerDbId, isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, timeDisasterRecoveryRoleChanged, remoteDisasterRecoveryConfiguration, localStandbyDb, failedDataRecoveryInSeconds, isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted, licenseModel, ncharacterSet, lifecycleDetails, provisioningState, lifecycleState, scheduledOperations, privateEndpointIP, privateEndpointLabel, ociUri, subnetId, vnetId, timeCreated, timeMaintenanceBegin, timeMaintenanceEnd, actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs, apexDetails, availableUpgradeVersions, connectionStrings, connectionUrls, dataSafeStatus, databaseEdition, autonomousDatabaseId, inMemoryAreaInGbs, nextLongTermBackupTimeStamp, longTermBackupSchedule, isPreview, localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs, openMode, operationsInsightsStatus, permissionLevel, privateEndpoint, provisionableCpus, role, serviceConsoleUri, sqlWebDeveloperUri, supportedRegionsToCloneTo, timeDataGuardRoleChanged, timeDeletionOfFreeAutonomousDatabase, timeLocalDataGuardEnabled, timeOfLastFailover, timeOfLastRefresh, timeOfLastRefreshPoint, timeOfLastSwitchover, timeReclamationOfFreeAutonomousDatabase, usedDataStorageSizeInGbs, usedDataStorageSizeInTbs, ocid, backupRetentionPeriodInDays, whitelistedIPs, serializedAdditionalRawData) + { + Source = source; + SourceId = sourceId; + CloneType = cloneType; + IsReconnectCloneEnabled = isReconnectCloneEnabled; + IsRefreshableClone = isRefreshableClone; + RefreshableModel = refreshableModel; + RefreshableStatus = refreshableStatus; + TimeUntilReconnectCloneEnabled = timeUntilReconnectCloneEnabled; + DataBaseType = dataBaseType; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDatabaseCloneProperties() + { + } + + /// The source of the database. + public SourceType? Source { get; set; } + /// The Azure resource ID of the Autonomous Database that was cloned to create the current Autonomous Database. + public ResourceIdentifier SourceId { get; set; } + /// The Autonomous Database clone type. + public CloneType CloneType { get; set; } + /// Indicates if the refreshable clone can be reconnected to its source database. + public bool? IsReconnectCloneEnabled { get; } + /// Indicates if the Autonomous Database is a refreshable clone. + public bool? IsRefreshableClone { get; } + /// The refresh mode of the clone. + public RefreshableModelType? RefreshableModel { get; set; } + /// The refresh status of the clone. + public RefreshableStatusType? RefreshableStatus { get; } + /// The time and date as an RFC3339 formatted string, e.g., 2022-01-01T12:00:00.000Z, to set the limit for a refreshable clone to be reconnected to its source database. + public string TimeUntilReconnectCloneEnabled { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.Serialization.cs new file mode 100644 index 000000000000..f37f24c30de6 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.Serialization.cs @@ -0,0 +1,957 @@ +// 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.OracleDatabase.Models +{ + public partial class AutonomousDatabaseCrossRegionDisasterRecoveryProperties : 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(AutonomousDatabaseCrossRegionDisasterRecoveryProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source.ToString()); + writer.WritePropertyName("sourceId"u8); + writer.WriteStringValue(SourceId); + if (Optional.IsDefined(SourceLocation)) + { + writer.WritePropertyName("sourceLocation"u8); + writer.WriteStringValue(SourceLocation); + } + if (Optional.IsDefined(SourceOcid)) + { + writer.WritePropertyName("sourceOcid"u8); + writer.WriteStringValue(SourceOcid); + } + writer.WritePropertyName("remoteDisasterRecoveryType"u8); + writer.WriteStringValue(RemoteDisasterRecoveryType.ToString()); + if (Optional.IsDefined(IsReplicateAutomaticBackups)) + { + writer.WritePropertyName("isReplicateAutomaticBackups"u8); + writer.WriteBooleanValue(IsReplicateAutomaticBackups.Value); + } + } + + AutonomousDatabaseCrossRegionDisasterRecoveryProperties 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(AutonomousDatabaseCrossRegionDisasterRecoveryProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseCrossRegionDisasterRecoveryProperties(document.RootElement, options); + } + + internal static AutonomousDatabaseCrossRegionDisasterRecoveryProperties DeserializeAutonomousDatabaseCrossRegionDisasterRecoveryProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SourceType source = default; + ResourceIdentifier sourceId = default; + string sourceLocation = default; + string sourceOcid = default; + DisasterRecoveryType remoteDisasterRecoveryType = default; + bool? isReplicateAutomaticBackups = default; + string adminPassword = default; + DataBaseType dataBaseType = default; + AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = default; + string characterSet = default; + float? computeCount = default; + ComputeModel? computeModel = default; + int? cpuCoreCount = default; + IList customerContacts = default; + int? dataStorageSizeInTbs = default; + int? dataStorageSizeInGbs = default; + string dbVersion = default; + WorkloadType? dbWorkload = default; + string displayName = default; + bool? isAutoScalingEnabled = default; + bool? isAutoScalingForStorageEnabled = default; + IReadOnlyList peerDbIds = default; + string peerDbId = default; + bool? isLocalDataGuardEnabled = default; + bool? isRemoteDataGuardEnabled = default; + DisasterRecoveryType? localDisasterRecoveryType = default; + DateTimeOffset? timeDisasterRecoveryRoleChanged = default; + DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = default; + AutonomousDatabaseStandbySummary localStandbyDb = default; + int? failedDataRecoveryInSeconds = default; + bool? isMtlsConnectionRequired = default; + bool? isPreviewVersionWithServiceTermsAccepted = default; + LicenseModel? licenseModel = default; + string ncharacterSet = default; + string lifecycleDetails = default; + AzureResourceProvisioningState? provisioningState = default; + AutonomousDatabaseLifecycleState? lifecycleState = default; + ScheduledOperationsType scheduledOperations = default; + string privateEndpointIP = default; + string privateEndpointLabel = default; + string ociUrl = default; + ResourceIdentifier subnetId = default; + ResourceIdentifier vnetId = default; + DateTimeOffset? timeCreated = default; + DateTimeOffset? timeMaintenanceBegin = default; + DateTimeOffset? timeMaintenanceEnd = default; + double? actualUsedDataStorageSizeInTbs = default; + double? allocatedStorageSizeInTbs = default; + ApexDetailsType apexDetails = default; + IReadOnlyList availableUpgradeVersions = default; + ConnectionStringType connectionStrings = default; + ConnectionUrlType connectionUrls = default; + DataSafeStatusType? dataSafeStatus = default; + DatabaseEditionType? databaseEdition = default; + ResourceIdentifier autonomousDatabaseId = default; + int? inMemoryAreaInGbs = default; + DateTimeOffset? nextLongTermBackupTimeStamp = default; + LongTermBackUpScheduleDetails longTermBackupSchedule = default; + bool? isPreview = default; + int? localAdgAutoFailoverMaxDataLossLimit = default; + int? memoryPerOracleComputeUnitInGbs = default; + OpenModeType? openMode = default; + OperationsInsightsStatusType? operationsInsightsStatus = default; + PermissionLevelType? permissionLevel = default; + string privateEndpoint = default; + IReadOnlyList provisionableCpus = default; + RoleType? role = default; + string serviceConsoleUrl = default; + string sqlWebDeveloperUrl = default; + IReadOnlyList supportedRegionsToCloneTo = default; + string timeDataGuardRoleChanged = default; + string timeDeletionOfFreeAutonomousDatabase = default; + string timeLocalDataGuardEnabled = default; + string timeOfLastFailover = default; + string timeOfLastRefresh = default; + string timeOfLastRefreshPoint = default; + string timeOfLastSwitchover = default; + string timeReclamationOfFreeAutonomousDatabase = default; + int? usedDataStorageSizeInGbs = default; + int? usedDataStorageSizeInTbs = default; + string ocid = default; + int? backupRetentionPeriodInDays = default; + IList whitelistedIPs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + source = new SourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceId"u8)) + { + sourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceLocation"u8)) + { + sourceLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceOcid"u8)) + { + sourceOcid = property.Value.GetString(); + continue; + } + if (property.NameEquals("remoteDisasterRecoveryType"u8)) + { + remoteDisasterRecoveryType = new DisasterRecoveryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("isReplicateAutomaticBackups"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isReplicateAutomaticBackups = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("adminPassword"u8)) + { + adminPassword = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataBaseType"u8)) + { + dataBaseType = new DataBaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autonomousMaintenanceScheduleType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousMaintenanceScheduleType = new AutonomousMaintenanceScheduleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("characterSet"u8)) + { + characterSet = property.Value.GetString(); + continue; + } + if (property.NameEquals("computeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeCount = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new ComputeModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("cpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("customerContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CustomerContact.DeserializeCustomerContact(item, options)); + } + customerContacts = array; + continue; + } + if (property.NameEquals("dataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dbVersion"u8)) + { + dbVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("dbWorkload"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbWorkload = new WorkloadType(property.Value.GetString()); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isAutoScalingEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isAutoScalingForStorageEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingForStorageEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("peerDbIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + peerDbIds = array; + continue; + } + if (property.NameEquals("peerDbId"u8)) + { + peerDbId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isLocalDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isLocalDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isRemoteDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isRemoteDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("localDisasterRecoveryType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localDisasterRecoveryType = new DisasterRecoveryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeDisasterRecoveryRoleChanged"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeDisasterRecoveryRoleChanged = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("remoteDisasterRecoveryConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remoteDisasterRecoveryConfiguration = DisasterRecoveryConfigurationDetails.DeserializeDisasterRecoveryConfigurationDetails(property.Value, options); + continue; + } + if (property.NameEquals("localStandbyDb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localStandbyDb = AutonomousDatabaseStandbySummary.DeserializeAutonomousDatabaseStandbySummary(property.Value, options); + continue; + } + if (property.NameEquals("failedDataRecoveryInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failedDataRecoveryInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isMtlsConnectionRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMtlsConnectionRequired = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isPreviewVersionWithServiceTermsAccepted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPreviewVersionWithServiceTermsAccepted = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("licenseModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + licenseModel = new LicenseModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("ncharacterSet"u8)) + { + ncharacterSet = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new AutonomousDatabaseLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("scheduledOperations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledOperations = ScheduledOperationsType.DeserializeScheduledOperationsType(property.Value, options); + continue; + } + if (property.NameEquals("privateEndpointIp"u8)) + { + privateEndpointIP = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateEndpointLabel"u8)) + { + privateEndpointLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("ociUrl"u8)) + { + ociUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceBegin"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceBegin = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceEnd"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceEnd = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("actualUsedDataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + actualUsedDataStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("allocatedStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocatedStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("apexDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + apexDetails = ApexDetailsType.DeserializeApexDetailsType(property.Value, options); + continue; + } + if (property.NameEquals("availableUpgradeVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableUpgradeVersions = array; + continue; + } + if (property.NameEquals("connectionStrings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionStrings = ConnectionStringType.DeserializeConnectionStringType(property.Value, options); + continue; + } + if (property.NameEquals("connectionUrls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionUrls = ConnectionUrlType.DeserializeConnectionUrlType(property.Value, options); + continue; + } + if (property.NameEquals("dataSafeStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataSafeStatus = new DataSafeStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseEdition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseEdition = new DatabaseEditionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autonomousDatabaseId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousDatabaseId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("inMemoryAreaInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inMemoryAreaInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nextLongTermBackupTimeStamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLongTermBackupTimeStamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("longTermBackupSchedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + longTermBackupSchedule = LongTermBackUpScheduleDetails.DeserializeLongTermBackUpScheduleDetails(property.Value, options); + continue; + } + if (property.NameEquals("isPreview"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPreview = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("localAdgAutoFailoverMaxDataLossLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localAdgAutoFailoverMaxDataLossLimit = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("memoryPerOracleComputeUnitInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memoryPerOracleComputeUnitInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("openMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + openMode = new OpenModeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("operationsInsightsStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operationsInsightsStatus = new OperationsInsightsStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("permissionLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + permissionLevel = new PermissionLevelType(property.Value.GetString()); + continue; + } + if (property.NameEquals("privateEndpoint"u8)) + { + privateEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisionableCpus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + provisionableCpus = array; + continue; + } + if (property.NameEquals("role"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + role = new RoleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceConsoleUrl"u8)) + { + serviceConsoleUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("sqlWebDeveloperUrl"u8)) + { + sqlWebDeveloperUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("supportedRegionsToCloneTo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + supportedRegionsToCloneTo = array; + continue; + } + if (property.NameEquals("timeDataGuardRoleChanged"u8)) + { + timeDataGuardRoleChanged = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeDeletionOfFreeAutonomousDatabase"u8)) + { + timeDeletionOfFreeAutonomousDatabase = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeLocalDataGuardEnabled"u8)) + { + timeLocalDataGuardEnabled = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastFailover"u8)) + { + timeOfLastFailover = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastRefresh"u8)) + { + timeOfLastRefresh = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastRefreshPoint"u8)) + { + timeOfLastRefreshPoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastSwitchover"u8)) + { + timeOfLastSwitchover = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeReclamationOfFreeAutonomousDatabase"u8)) + { + timeReclamationOfFreeAutonomousDatabase = property.Value.GetString(); + continue; + } + if (property.NameEquals("usedDataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedDataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("usedDataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedDataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("backupRetentionPeriodInDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backupRetentionPeriodInDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("whitelistedIps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + whitelistedIPs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutonomousDatabaseCrossRegionDisasterRecoveryProperties( + adminPassword, + dataBaseType, + autonomousMaintenanceScheduleType, + characterSet, + computeCount, + computeModel, + cpuCoreCount, + customerContacts ?? new ChangeTrackingList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + dbVersion, + dbWorkload, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDbIds ?? new ChangeTrackingList(), + peerDbId, + isLocalDataGuardEnabled, + isRemoteDataGuardEnabled, + localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, + localStandbyDb, + failedDataRecoveryInSeconds, + isMtlsConnectionRequired, + isPreviewVersionWithServiceTermsAccepted, + licenseModel, + ncharacterSet, + lifecycleDetails, + provisioningState, + lifecycleState, + scheduledOperations, + privateEndpointIP, + privateEndpointLabel, + ociUrl, + subnetId, + vnetId, + timeCreated, + timeMaintenanceBegin, + timeMaintenanceEnd, + actualUsedDataStorageSizeInTbs, + allocatedStorageSizeInTbs, + apexDetails, + availableUpgradeVersions ?? new ChangeTrackingList(), + connectionStrings, + connectionUrls, + dataSafeStatus, + databaseEdition, + autonomousDatabaseId, + inMemoryAreaInGbs, + nextLongTermBackupTimeStamp, + longTermBackupSchedule, + isPreview, + localAdgAutoFailoverMaxDataLossLimit, + memoryPerOracleComputeUnitInGbs, + openMode, + operationsInsightsStatus, + permissionLevel, + privateEndpoint, + provisionableCpus ?? new ChangeTrackingList(), + role, + serviceConsoleUrl, + sqlWebDeveloperUrl, + supportedRegionsToCloneTo ?? new ChangeTrackingList(), + timeDataGuardRoleChanged, + timeDeletionOfFreeAutonomousDatabase, + timeLocalDataGuardEnabled, + timeOfLastFailover, + timeOfLastRefresh, + timeOfLastRefreshPoint, + timeOfLastSwitchover, + timeReclamationOfFreeAutonomousDatabase, + usedDataStorageSizeInGbs, + usedDataStorageSizeInTbs, + ocid, + backupRetentionPeriodInDays, + whitelistedIPs ?? new ChangeTrackingList(), + serializedAdditionalRawData, + source, + sourceId, + sourceLocation, + sourceOcid, + remoteDisasterRecoveryType, + isReplicateAutomaticBackups); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseCrossRegionDisasterRecoveryProperties)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseCrossRegionDisasterRecoveryProperties 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 DeserializeAutonomousDatabaseCrossRegionDisasterRecoveryProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseCrossRegionDisasterRecoveryProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.cs new file mode 100644 index 000000000000..576720a19267 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCrossRegionDisasterRecoveryProperties.cs @@ -0,0 +1,145 @@ +// 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.OracleDatabase.Models +{ + /// Autonomous Database Cross Region Disaster Recovery resource model. + public partial class AutonomousDatabaseCrossRegionDisasterRecoveryProperties : AutonomousDatabaseBaseProperties + { + /// Initializes a new instance of . + /// The Azure ID of the source Autonomous Database that will be used to create a new peer database for the DR association. + /// Indicates the cross-region disaster recovery (DR) type of the standby Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// is null. + public AutonomousDatabaseCrossRegionDisasterRecoveryProperties(ResourceIdentifier sourceId, DisasterRecoveryType remoteDisasterRecoveryType) + { + Argument.AssertNotNull(sourceId, nameof(sourceId)); + + Source = SourceType.CrossRegionDisasterRecovery; + SourceId = sourceId; + RemoteDisasterRecoveryType = remoteDisasterRecoveryType; + DataBaseType = DataBaseType.CrossRegionDisasterRecovery; + } + + /// Initializes a new instance of . + /// Admin password. + /// Database type to be created. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// Keeps track of any properties unknown to the library. + /// The source of the database. + /// The Azure ID of the source Autonomous Database that will be used to create a new peer database for the DR association. + /// The name of the region where source Autonomous Database exists. + /// The source database ocid. + /// Indicates the cross-region disaster recovery (DR) type of the standby Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the backups taken on the Primary are not replicated to the Standby database. + internal AutonomousDatabaseCrossRegionDisasterRecoveryProperties(string adminPassword, DataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, ComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, WorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDbIds, string peerDbId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, DateTimeOffset? timeDisasterRecoveryRoleChanged, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration, AutonomousDatabaseStandbySummary localStandbyDb, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, LicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, AzureResourceProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, string ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? timeCreated, DateTimeOffset? timeMaintenanceBegin, DateTimeOffset? timeMaintenanceEnd, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, ApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, ConnectionStringType connectionStrings, ConnectionUrlType connectionUrls, DataSafeStatusType? dataSafeStatus, DatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupTimeStamp, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, OpenModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, PermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, RoleType? role, string serviceConsoleUri, string sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, string timeDataGuardRoleChanged, string timeDeletionOfFreeAutonomousDatabase, string timeLocalDataGuardEnabled, string timeOfLastFailover, string timeOfLastRefresh, string timeOfLastRefreshPoint, string timeOfLastSwitchover, string timeReclamationOfFreeAutonomousDatabase, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, string ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData, SourceType source, ResourceIdentifier sourceId, string sourceLocation, string sourceOcid, DisasterRecoveryType remoteDisasterRecoveryType, bool? isReplicateAutomaticBackups) : base(adminPassword, dataBaseType, autonomousMaintenanceScheduleType, characterSet, computeCount, computeModel, cpuCoreCount, customerContacts, dataStorageSizeInTbs, dataStorageSizeInGbs, dbVersion, dbWorkload, displayName, isAutoScalingEnabled, isAutoScalingForStorageEnabled, peerDbIds, peerDbId, isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, timeDisasterRecoveryRoleChanged, remoteDisasterRecoveryConfiguration, localStandbyDb, failedDataRecoveryInSeconds, isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted, licenseModel, ncharacterSet, lifecycleDetails, provisioningState, lifecycleState, scheduledOperations, privateEndpointIP, privateEndpointLabel, ociUri, subnetId, vnetId, timeCreated, timeMaintenanceBegin, timeMaintenanceEnd, actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs, apexDetails, availableUpgradeVersions, connectionStrings, connectionUrls, dataSafeStatus, databaseEdition, autonomousDatabaseId, inMemoryAreaInGbs, nextLongTermBackupTimeStamp, longTermBackupSchedule, isPreview, localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs, openMode, operationsInsightsStatus, permissionLevel, privateEndpoint, provisionableCpus, role, serviceConsoleUri, sqlWebDeveloperUri, supportedRegionsToCloneTo, timeDataGuardRoleChanged, timeDeletionOfFreeAutonomousDatabase, timeLocalDataGuardEnabled, timeOfLastFailover, timeOfLastRefresh, timeOfLastRefreshPoint, timeOfLastSwitchover, timeReclamationOfFreeAutonomousDatabase, usedDataStorageSizeInGbs, usedDataStorageSizeInTbs, ocid, backupRetentionPeriodInDays, whitelistedIPs, serializedAdditionalRawData) + { + Source = source; + SourceId = sourceId; + SourceLocation = sourceLocation; + SourceOcid = sourceOcid; + RemoteDisasterRecoveryType = remoteDisasterRecoveryType; + IsReplicateAutomaticBackups = isReplicateAutomaticBackups; + DataBaseType = dataBaseType; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDatabaseCrossRegionDisasterRecoveryProperties() + { + } + + /// The source of the database. + public SourceType Source { get; } + /// The Azure ID of the source Autonomous Database that will be used to create a new peer database for the DR association. + public ResourceIdentifier SourceId { get; set; } + /// The name of the region where source Autonomous Database exists. + public string SourceLocation { get; set; } + /// The source database ocid. + public string SourceOcid { get; set; } + /// Indicates the cross-region disaster recovery (DR) type of the standby Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + public DisasterRecoveryType RemoteDisasterRecoveryType { get; set; } + /// If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the backups taken on the Primary are not replicated to the Standby database. + public bool? IsReplicateAutomaticBackups { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.Serialization.cs new file mode 100644 index 000000000000..613aac12de77 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.Serialization.cs @@ -0,0 +1,949 @@ +// 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.OracleDatabase.Models +{ + public partial class AutonomousDatabaseFromBackupTimestampProperties : 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(AutonomousDatabaseFromBackupTimestampProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source.ToString()); + writer.WritePropertyName("sourceId"u8); + writer.WriteStringValue(SourceId); + writer.WritePropertyName("cloneType"u8); + writer.WriteStringValue(CloneType.ToString()); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } + if (Optional.IsDefined(UseLatestAvailableBackupTimeStamp)) + { + writer.WritePropertyName("useLatestAvailableBackupTimeStamp"u8); + writer.WriteBooleanValue(UseLatestAvailableBackupTimeStamp.Value); + } + } + + AutonomousDatabaseFromBackupTimestampProperties 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(AutonomousDatabaseFromBackupTimestampProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseFromBackupTimestampProperties(document.RootElement, options); + } + + internal static AutonomousDatabaseFromBackupTimestampProperties DeserializeAutonomousDatabaseFromBackupTimestampProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SourceType source = default; + ResourceIdentifier sourceId = default; + CloneType cloneType = default; + DateTimeOffset? timestamp = default; + bool? useLatestAvailableBackupTimeStamp = default; + string adminPassword = default; + DataBaseType dataBaseType = default; + AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = default; + string characterSet = default; + float? computeCount = default; + ComputeModel? computeModel = default; + int? cpuCoreCount = default; + IList customerContacts = default; + int? dataStorageSizeInTbs = default; + int? dataStorageSizeInGbs = default; + string dbVersion = default; + WorkloadType? dbWorkload = default; + string displayName = default; + bool? isAutoScalingEnabled = default; + bool? isAutoScalingForStorageEnabled = default; + IReadOnlyList peerDbIds = default; + string peerDbId = default; + bool? isLocalDataGuardEnabled = default; + bool? isRemoteDataGuardEnabled = default; + DisasterRecoveryType? localDisasterRecoveryType = default; + DateTimeOffset? timeDisasterRecoveryRoleChanged = default; + DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = default; + AutonomousDatabaseStandbySummary localStandbyDb = default; + int? failedDataRecoveryInSeconds = default; + bool? isMtlsConnectionRequired = default; + bool? isPreviewVersionWithServiceTermsAccepted = default; + LicenseModel? licenseModel = default; + string ncharacterSet = default; + string lifecycleDetails = default; + AzureResourceProvisioningState? provisioningState = default; + AutonomousDatabaseLifecycleState? lifecycleState = default; + ScheduledOperationsType scheduledOperations = default; + string privateEndpointIP = default; + string privateEndpointLabel = default; + string ociUrl = default; + ResourceIdentifier subnetId = default; + ResourceIdentifier vnetId = default; + DateTimeOffset? timeCreated = default; + DateTimeOffset? timeMaintenanceBegin = default; + DateTimeOffset? timeMaintenanceEnd = default; + double? actualUsedDataStorageSizeInTbs = default; + double? allocatedStorageSizeInTbs = default; + ApexDetailsType apexDetails = default; + IReadOnlyList availableUpgradeVersions = default; + ConnectionStringType connectionStrings = default; + ConnectionUrlType connectionUrls = default; + DataSafeStatusType? dataSafeStatus = default; + DatabaseEditionType? databaseEdition = default; + ResourceIdentifier autonomousDatabaseId = default; + int? inMemoryAreaInGbs = default; + DateTimeOffset? nextLongTermBackupTimeStamp = default; + LongTermBackUpScheduleDetails longTermBackupSchedule = default; + bool? isPreview = default; + int? localAdgAutoFailoverMaxDataLossLimit = default; + int? memoryPerOracleComputeUnitInGbs = default; + OpenModeType? openMode = default; + OperationsInsightsStatusType? operationsInsightsStatus = default; + PermissionLevelType? permissionLevel = default; + string privateEndpoint = default; + IReadOnlyList provisionableCpus = default; + RoleType? role = default; + string serviceConsoleUrl = default; + string sqlWebDeveloperUrl = default; + IReadOnlyList supportedRegionsToCloneTo = default; + string timeDataGuardRoleChanged = default; + string timeDeletionOfFreeAutonomousDatabase = default; + string timeLocalDataGuardEnabled = default; + string timeOfLastFailover = default; + string timeOfLastRefresh = default; + string timeOfLastRefreshPoint = default; + string timeOfLastSwitchover = default; + string timeReclamationOfFreeAutonomousDatabase = default; + int? usedDataStorageSizeInGbs = default; + int? usedDataStorageSizeInTbs = default; + string ocid = default; + int? backupRetentionPeriodInDays = default; + IList whitelistedIPs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + source = new SourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceId"u8)) + { + sourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("cloneType"u8)) + { + cloneType = new CloneType(property.Value.GetString()); + continue; + } + if (property.NameEquals("timestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("useLatestAvailableBackupTimeStamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useLatestAvailableBackupTimeStamp = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("adminPassword"u8)) + { + adminPassword = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataBaseType"u8)) + { + dataBaseType = new DataBaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autonomousMaintenanceScheduleType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousMaintenanceScheduleType = new AutonomousMaintenanceScheduleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("characterSet"u8)) + { + characterSet = property.Value.GetString(); + continue; + } + if (property.NameEquals("computeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeCount = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new ComputeModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("cpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("customerContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CustomerContact.DeserializeCustomerContact(item, options)); + } + customerContacts = array; + continue; + } + if (property.NameEquals("dataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dbVersion"u8)) + { + dbVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("dbWorkload"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbWorkload = new WorkloadType(property.Value.GetString()); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isAutoScalingEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isAutoScalingForStorageEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingForStorageEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("peerDbIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + peerDbIds = array; + continue; + } + if (property.NameEquals("peerDbId"u8)) + { + peerDbId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isLocalDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isLocalDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isRemoteDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isRemoteDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("localDisasterRecoveryType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localDisasterRecoveryType = new DisasterRecoveryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeDisasterRecoveryRoleChanged"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeDisasterRecoveryRoleChanged = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("remoteDisasterRecoveryConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remoteDisasterRecoveryConfiguration = DisasterRecoveryConfigurationDetails.DeserializeDisasterRecoveryConfigurationDetails(property.Value, options); + continue; + } + if (property.NameEquals("localStandbyDb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localStandbyDb = AutonomousDatabaseStandbySummary.DeserializeAutonomousDatabaseStandbySummary(property.Value, options); + continue; + } + if (property.NameEquals("failedDataRecoveryInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failedDataRecoveryInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isMtlsConnectionRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMtlsConnectionRequired = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isPreviewVersionWithServiceTermsAccepted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPreviewVersionWithServiceTermsAccepted = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("licenseModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + licenseModel = new LicenseModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("ncharacterSet"u8)) + { + ncharacterSet = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new AutonomousDatabaseLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("scheduledOperations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledOperations = ScheduledOperationsType.DeserializeScheduledOperationsType(property.Value, options); + continue; + } + if (property.NameEquals("privateEndpointIp"u8)) + { + privateEndpointIP = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateEndpointLabel"u8)) + { + privateEndpointLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("ociUrl"u8)) + { + ociUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceBegin"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceBegin = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceEnd"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceEnd = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("actualUsedDataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + actualUsedDataStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("allocatedStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocatedStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("apexDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + apexDetails = ApexDetailsType.DeserializeApexDetailsType(property.Value, options); + continue; + } + if (property.NameEquals("availableUpgradeVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableUpgradeVersions = array; + continue; + } + if (property.NameEquals("connectionStrings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionStrings = ConnectionStringType.DeserializeConnectionStringType(property.Value, options); + continue; + } + if (property.NameEquals("connectionUrls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionUrls = ConnectionUrlType.DeserializeConnectionUrlType(property.Value, options); + continue; + } + if (property.NameEquals("dataSafeStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataSafeStatus = new DataSafeStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseEdition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseEdition = new DatabaseEditionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autonomousDatabaseId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousDatabaseId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("inMemoryAreaInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inMemoryAreaInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nextLongTermBackupTimeStamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLongTermBackupTimeStamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("longTermBackupSchedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + longTermBackupSchedule = LongTermBackUpScheduleDetails.DeserializeLongTermBackUpScheduleDetails(property.Value, options); + continue; + } + if (property.NameEquals("isPreview"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPreview = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("localAdgAutoFailoverMaxDataLossLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localAdgAutoFailoverMaxDataLossLimit = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("memoryPerOracleComputeUnitInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memoryPerOracleComputeUnitInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("openMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + openMode = new OpenModeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("operationsInsightsStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operationsInsightsStatus = new OperationsInsightsStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("permissionLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + permissionLevel = new PermissionLevelType(property.Value.GetString()); + continue; + } + if (property.NameEquals("privateEndpoint"u8)) + { + privateEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisionableCpus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + provisionableCpus = array; + continue; + } + if (property.NameEquals("role"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + role = new RoleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceConsoleUrl"u8)) + { + serviceConsoleUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("sqlWebDeveloperUrl"u8)) + { + sqlWebDeveloperUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("supportedRegionsToCloneTo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + supportedRegionsToCloneTo = array; + continue; + } + if (property.NameEquals("timeDataGuardRoleChanged"u8)) + { + timeDataGuardRoleChanged = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeDeletionOfFreeAutonomousDatabase"u8)) + { + timeDeletionOfFreeAutonomousDatabase = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeLocalDataGuardEnabled"u8)) + { + timeLocalDataGuardEnabled = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastFailover"u8)) + { + timeOfLastFailover = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastRefresh"u8)) + { + timeOfLastRefresh = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastRefreshPoint"u8)) + { + timeOfLastRefreshPoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastSwitchover"u8)) + { + timeOfLastSwitchover = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeReclamationOfFreeAutonomousDatabase"u8)) + { + timeReclamationOfFreeAutonomousDatabase = property.Value.GetString(); + continue; + } + if (property.NameEquals("usedDataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedDataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("usedDataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedDataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("backupRetentionPeriodInDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backupRetentionPeriodInDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("whitelistedIps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + whitelistedIPs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutonomousDatabaseFromBackupTimestampProperties( + adminPassword, + dataBaseType, + autonomousMaintenanceScheduleType, + characterSet, + computeCount, + computeModel, + cpuCoreCount, + customerContacts ?? new ChangeTrackingList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + dbVersion, + dbWorkload, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDbIds ?? new ChangeTrackingList(), + peerDbId, + isLocalDataGuardEnabled, + isRemoteDataGuardEnabled, + localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, + localStandbyDb, + failedDataRecoveryInSeconds, + isMtlsConnectionRequired, + isPreviewVersionWithServiceTermsAccepted, + licenseModel, + ncharacterSet, + lifecycleDetails, + provisioningState, + lifecycleState, + scheduledOperations, + privateEndpointIP, + privateEndpointLabel, + ociUrl, + subnetId, + vnetId, + timeCreated, + timeMaintenanceBegin, + timeMaintenanceEnd, + actualUsedDataStorageSizeInTbs, + allocatedStorageSizeInTbs, + apexDetails, + availableUpgradeVersions ?? new ChangeTrackingList(), + connectionStrings, + connectionUrls, + dataSafeStatus, + databaseEdition, + autonomousDatabaseId, + inMemoryAreaInGbs, + nextLongTermBackupTimeStamp, + longTermBackupSchedule, + isPreview, + localAdgAutoFailoverMaxDataLossLimit, + memoryPerOracleComputeUnitInGbs, + openMode, + operationsInsightsStatus, + permissionLevel, + privateEndpoint, + provisionableCpus ?? new ChangeTrackingList(), + role, + serviceConsoleUrl, + sqlWebDeveloperUrl, + supportedRegionsToCloneTo ?? new ChangeTrackingList(), + timeDataGuardRoleChanged, + timeDeletionOfFreeAutonomousDatabase, + timeLocalDataGuardEnabled, + timeOfLastFailover, + timeOfLastRefresh, + timeOfLastRefreshPoint, + timeOfLastSwitchover, + timeReclamationOfFreeAutonomousDatabase, + usedDataStorageSizeInGbs, + usedDataStorageSizeInTbs, + ocid, + backupRetentionPeriodInDays, + whitelistedIPs ?? new ChangeTrackingList(), + serializedAdditionalRawData, + source, + sourceId, + cloneType, + timestamp, + useLatestAvailableBackupTimeStamp); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseFromBackupTimestampProperties)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseFromBackupTimestampProperties 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 DeserializeAutonomousDatabaseFromBackupTimestampProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseFromBackupTimestampProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.cs new file mode 100644 index 000000000000..31b201ad386c --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseFromBackupTimestampProperties.cs @@ -0,0 +1,141 @@ +// 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.OracleDatabase.Models +{ + /// Autonomous Database From Backup Timestamp resource model. + public partial class AutonomousDatabaseFromBackupTimestampProperties : AutonomousDatabaseBaseProperties + { + /// Initializes a new instance of . + /// The ID of the source Autonomous Database that you will clone to create a new Autonomous Database. + /// The Autonomous Database clone type. + /// is null. + public AutonomousDatabaseFromBackupTimestampProperties(ResourceIdentifier sourceId, CloneType cloneType) + { + Argument.AssertNotNull(sourceId, nameof(sourceId)); + + Source = SourceType.BackupFromTimestamp; + SourceId = sourceId; + CloneType = cloneType; + DataBaseType = DataBaseType.CloneFromBackupTimestamp; + } + + /// Initializes a new instance of . + /// Admin password. + /// Database type to be created. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// Keeps track of any properties unknown to the library. + /// The source of the database. + /// The ID of the source Autonomous Database that you will clone to create a new Autonomous Database. + /// The Autonomous Database clone type. + /// The timestamp specified for the point-in-time clone of the source Autonomous Database. The timestamp must be in the past. + /// Clone from latest available backup timestamp. + internal AutonomousDatabaseFromBackupTimestampProperties(string adminPassword, DataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, ComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, WorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDbIds, string peerDbId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, DateTimeOffset? timeDisasterRecoveryRoleChanged, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration, AutonomousDatabaseStandbySummary localStandbyDb, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, LicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, AzureResourceProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, string ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? timeCreated, DateTimeOffset? timeMaintenanceBegin, DateTimeOffset? timeMaintenanceEnd, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, ApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, ConnectionStringType connectionStrings, ConnectionUrlType connectionUrls, DataSafeStatusType? dataSafeStatus, DatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupTimeStamp, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, OpenModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, PermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, RoleType? role, string serviceConsoleUri, string sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, string timeDataGuardRoleChanged, string timeDeletionOfFreeAutonomousDatabase, string timeLocalDataGuardEnabled, string timeOfLastFailover, string timeOfLastRefresh, string timeOfLastRefreshPoint, string timeOfLastSwitchover, string timeReclamationOfFreeAutonomousDatabase, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, string ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData, SourceType source, ResourceIdentifier sourceId, CloneType cloneType, DateTimeOffset? timestamp, bool? useLatestAvailableBackupTimeStamp) : base(adminPassword, dataBaseType, autonomousMaintenanceScheduleType, characterSet, computeCount, computeModel, cpuCoreCount, customerContacts, dataStorageSizeInTbs, dataStorageSizeInGbs, dbVersion, dbWorkload, displayName, isAutoScalingEnabled, isAutoScalingForStorageEnabled, peerDbIds, peerDbId, isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, timeDisasterRecoveryRoleChanged, remoteDisasterRecoveryConfiguration, localStandbyDb, failedDataRecoveryInSeconds, isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted, licenseModel, ncharacterSet, lifecycleDetails, provisioningState, lifecycleState, scheduledOperations, privateEndpointIP, privateEndpointLabel, ociUri, subnetId, vnetId, timeCreated, timeMaintenanceBegin, timeMaintenanceEnd, actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs, apexDetails, availableUpgradeVersions, connectionStrings, connectionUrls, dataSafeStatus, databaseEdition, autonomousDatabaseId, inMemoryAreaInGbs, nextLongTermBackupTimeStamp, longTermBackupSchedule, isPreview, localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs, openMode, operationsInsightsStatus, permissionLevel, privateEndpoint, provisionableCpus, role, serviceConsoleUri, sqlWebDeveloperUri, supportedRegionsToCloneTo, timeDataGuardRoleChanged, timeDeletionOfFreeAutonomousDatabase, timeLocalDataGuardEnabled, timeOfLastFailover, timeOfLastRefresh, timeOfLastRefreshPoint, timeOfLastSwitchover, timeReclamationOfFreeAutonomousDatabase, usedDataStorageSizeInGbs, usedDataStorageSizeInTbs, ocid, backupRetentionPeriodInDays, whitelistedIPs, serializedAdditionalRawData) + { + Source = source; + SourceId = sourceId; + CloneType = cloneType; + Timestamp = timestamp; + UseLatestAvailableBackupTimeStamp = useLatestAvailableBackupTimeStamp; + DataBaseType = dataBaseType; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDatabaseFromBackupTimestampProperties() + { + } + + /// The source of the database. + public SourceType Source { get; } + /// The ID of the source Autonomous Database that you will clone to create a new Autonomous Database. + public ResourceIdentifier SourceId { get; set; } + /// The Autonomous Database clone type. + public CloneType CloneType { get; set; } + /// The timestamp specified for the point-in-time clone of the source Autonomous Database. The timestamp must be in the past. + public DateTimeOffset? Timestamp { get; set; } + /// Clone from latest available backup timestamp. + public bool? UseLatestAvailableBackupTimeStamp { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseLifecycleState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseLifecycleState.cs new file mode 100644 index 000000000000..0ca0ab918038 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseLifecycleState.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Autonomous database lifecycle state enum. + public readonly partial struct AutonomousDatabaseLifecycleState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutonomousDatabaseLifecycleState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProvisioningValue = "Provisioning"; + private const string AvailableValue = "Available"; + private const string StoppingValue = "Stopping"; + private const string StoppedValue = "Stopped"; + private const string StartingValue = "Starting"; + private const string TerminatingValue = "Terminating"; + private const string TerminatedValue = "Terminated"; + private const string UnavailableValue = "Unavailable"; + private const string RestoreInProgressValue = "RestoreInProgress"; + private const string RestoreFailedValue = "RestoreFailed"; + private const string BackupInProgressValue = "BackupInProgress"; + private const string ScaleInProgressValue = "ScaleInProgress"; + private const string AvailableNeedsAttentionValue = "AvailableNeedsAttention"; + private const string UpdatingValue = "Updating"; + private const string MaintenanceInProgressValue = "MaintenanceInProgress"; + private const string RestartingValue = "Restarting"; + private const string RecreatingValue = "Recreating"; + private const string RoleChangeInProgressValue = "RoleChangeInProgress"; + private const string UpgradingValue = "Upgrading"; + private const string InaccessibleValue = "Inaccessible"; + private const string StandbyValue = "Standby"; + + /// Indicates that resource in Provisioning state. + public static AutonomousDatabaseLifecycleState Provisioning { get; } = new AutonomousDatabaseLifecycleState(ProvisioningValue); + /// Indicates that resource in Available state. + public static AutonomousDatabaseLifecycleState Available { get; } = new AutonomousDatabaseLifecycleState(AvailableValue); + /// Indicates that resource in Stopping state. + public static AutonomousDatabaseLifecycleState Stopping { get; } = new AutonomousDatabaseLifecycleState(StoppingValue); + /// Indicates that resource in Stopped state. + public static AutonomousDatabaseLifecycleState Stopped { get; } = new AutonomousDatabaseLifecycleState(StoppedValue); + /// Indicates that resource in Starting state. + public static AutonomousDatabaseLifecycleState Starting { get; } = new AutonomousDatabaseLifecycleState(StartingValue); + /// Indicates that resource in Terminating state. + public static AutonomousDatabaseLifecycleState Terminating { get; } = new AutonomousDatabaseLifecycleState(TerminatingValue); + /// Indicates that resource in Terminated state. + public static AutonomousDatabaseLifecycleState Terminated { get; } = new AutonomousDatabaseLifecycleState(TerminatedValue); + /// Indicates that resource in Unavailable state. + public static AutonomousDatabaseLifecycleState Unavailable { get; } = new AutonomousDatabaseLifecycleState(UnavailableValue); + /// Indicates that resource in RestoreInProgress state. + public static AutonomousDatabaseLifecycleState RestoreInProgress { get; } = new AutonomousDatabaseLifecycleState(RestoreInProgressValue); + /// Indicates that resource in RestoreFailed state. + public static AutonomousDatabaseLifecycleState RestoreFailed { get; } = new AutonomousDatabaseLifecycleState(RestoreFailedValue); + /// Indicates that resource in BackupInProgress state. + public static AutonomousDatabaseLifecycleState BackupInProgress { get; } = new AutonomousDatabaseLifecycleState(BackupInProgressValue); + /// Indicates that resource in ScaleInProgress state. + public static AutonomousDatabaseLifecycleState ScaleInProgress { get; } = new AutonomousDatabaseLifecycleState(ScaleInProgressValue); + /// Indicates that resource is available but needs attention. + public static AutonomousDatabaseLifecycleState AvailableNeedsAttention { get; } = new AutonomousDatabaseLifecycleState(AvailableNeedsAttentionValue); + /// Indicates that resource in Updating state. + public static AutonomousDatabaseLifecycleState Updating { get; } = new AutonomousDatabaseLifecycleState(UpdatingValue); + /// Indicates that resource maintenance in progress state. + public static AutonomousDatabaseLifecycleState MaintenanceInProgress { get; } = new AutonomousDatabaseLifecycleState(MaintenanceInProgressValue); + /// Indicates that resource in Restarting state. + public static AutonomousDatabaseLifecycleState Restarting { get; } = new AutonomousDatabaseLifecycleState(RestartingValue); + /// Indicates that resource in Recreating state. + public static AutonomousDatabaseLifecycleState Recreating { get; } = new AutonomousDatabaseLifecycleState(RecreatingValue); + /// Indicates that resource role change in progress state. + public static AutonomousDatabaseLifecycleState RoleChangeInProgress { get; } = new AutonomousDatabaseLifecycleState(RoleChangeInProgressValue); + /// Indicates that resource in Upgrading state. + public static AutonomousDatabaseLifecycleState Upgrading { get; } = new AutonomousDatabaseLifecycleState(UpgradingValue); + /// IIndicates that resource in Inaccessible state. + public static AutonomousDatabaseLifecycleState Inaccessible { get; } = new AutonomousDatabaseLifecycleState(InaccessibleValue); + /// Indicates that resource in Standby state. + public static AutonomousDatabaseLifecycleState Standby { get; } = new AutonomousDatabaseLifecycleState(StandbyValue); + /// Determines if two values are the same. + public static bool operator ==(AutonomousDatabaseLifecycleState left, AutonomousDatabaseLifecycleState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutonomousDatabaseLifecycleState left, AutonomousDatabaseLifecycleState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutonomousDatabaseLifecycleState(string value) => new AutonomousDatabaseLifecycleState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutonomousDatabaseLifecycleState other && Equals(other); + /// + public bool Equals(AutonomousDatabaseLifecycleState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseListResult.Serialization.cs new file mode 100644 index 000000000000..cc38a33ed75d --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseListResult.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.OracleDatabase.Models +{ + internal partial class AutonomousDatabaseListResult : 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(AutonomousDatabaseListResult)} 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 + } + } + } + + AutonomousDatabaseListResult 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(AutonomousDatabaseListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseListResult(document.RootElement, options); + } + + internal static AutonomousDatabaseListResult DeserializeAutonomousDatabaseListResult(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(AutonomousDatabaseData.DeserializeAutonomousDatabaseData(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 AutonomousDatabaseListResult(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); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseListResult)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseListResult 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 DeserializeAutonomousDatabaseListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseListResult.cs new file mode 100644 index 000000000000..0883d4ab63a4 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseListResult.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.OracleDatabase.Models +{ + /// The response of a AutonomousDatabase list operation. + internal partial class AutonomousDatabaseListResult + { + /// + /// 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 AutonomousDatabase items on this page. + /// is null. + internal AutonomousDatabaseListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AutonomousDatabase items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AutonomousDatabaseListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDatabaseListResult() + { + } + + /// The AutonomousDatabase items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetListResult.Serialization.cs new file mode 100644 index 000000000000..d03800f6680f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetListResult.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.OracleDatabase.Models +{ + internal partial class AutonomousDatabaseNationalCharacterSetListResult : 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(AutonomousDatabaseNationalCharacterSetListResult)} 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 + } + } + } + + AutonomousDatabaseNationalCharacterSetListResult 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(AutonomousDatabaseNationalCharacterSetListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseNationalCharacterSetListResult(document.RootElement, options); + } + + internal static AutonomousDatabaseNationalCharacterSetListResult DeserializeAutonomousDatabaseNationalCharacterSetListResult(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(AutonomousDatabaseNationalCharacterSetData.DeserializeAutonomousDatabaseNationalCharacterSetData(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 AutonomousDatabaseNationalCharacterSetListResult(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); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseNationalCharacterSetListResult)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseNationalCharacterSetListResult 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 DeserializeAutonomousDatabaseNationalCharacterSetListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseNationalCharacterSetListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetListResult.cs new file mode 100644 index 000000000000..c5ade46c17a6 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetListResult.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.OracleDatabase.Models +{ + /// The response of a AutonomousDatabaseNationalCharacterSet list operation. + internal partial class AutonomousDatabaseNationalCharacterSetListResult + { + /// + /// 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 AutonomousDatabaseNationalCharacterSet items on this page. + /// is null. + internal AutonomousDatabaseNationalCharacterSetListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AutonomousDatabaseNationalCharacterSet items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AutonomousDatabaseNationalCharacterSetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDatabaseNationalCharacterSetListResult() + { + } + + /// The AutonomousDatabaseNationalCharacterSet items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.Serialization.cs new file mode 100644 index 000000000000..142187ebfe3b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.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.OracleDatabase.Models +{ + internal partial class AutonomousDatabaseNationalCharacterSetProperties : 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(AutonomousDatabaseNationalCharacterSetProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("characterSet"u8); + writer.WriteStringValue(CharacterSet); + 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 + } + } + } + + AutonomousDatabaseNationalCharacterSetProperties 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(AutonomousDatabaseNationalCharacterSetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseNationalCharacterSetProperties(document.RootElement, options); + } + + internal static AutonomousDatabaseNationalCharacterSetProperties DeserializeAutonomousDatabaseNationalCharacterSetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string characterSet = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("characterSet"u8)) + { + characterSet = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutonomousDatabaseNationalCharacterSetProperties(characterSet, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseNationalCharacterSetProperties)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseNationalCharacterSetProperties 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 DeserializeAutonomousDatabaseNationalCharacterSetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseNationalCharacterSetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.cs new file mode 100644 index 000000000000..408eb4c744b5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseNationalCharacterSetProperties.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.OracleDatabase.Models +{ + /// AutonomousDatabaseNationalCharacterSet resource model. + internal partial class AutonomousDatabaseNationalCharacterSetProperties + { + /// + /// 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 Oracle Autonomous Database supported national character sets. + /// is null. + internal AutonomousDatabaseNationalCharacterSetProperties(string characterSet) + { + Argument.AssertNotNull(characterSet, nameof(characterSet)); + + CharacterSet = characterSet; + } + + /// Initializes a new instance of . + /// The Oracle Autonomous Database supported national character sets. + /// Keeps track of any properties unknown to the library. + internal AutonomousDatabaseNationalCharacterSetProperties(string characterSet, IDictionary serializedAdditionalRawData) + { + CharacterSet = characterSet; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDatabaseNationalCharacterSetProperties() + { + } + + /// The Oracle Autonomous Database supported national character sets. + public string CharacterSet { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabasePatch.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabasePatch.Serialization.cs new file mode 100644 index 000000000000..32bd65f2b902 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabasePatch.Serialization.cs @@ -0,0 +1,159 @@ +// 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.OracleDatabase.Models +{ + public partial class AutonomousDatabasePatch : 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(AutonomousDatabasePatch)} does not support writing '{format}' format."); + } + + 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 (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 + } + } + } + + AutonomousDatabasePatch 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(AutonomousDatabasePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabasePatch(document.RootElement, options); + } + + internal static AutonomousDatabasePatch DeserializeAutonomousDatabasePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + AutonomousDatabaseUpdateProperties properties = 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 = AutonomousDatabaseUpdateProperties.DeserializeAutonomousDatabaseUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutonomousDatabasePatch(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); + default: + throw new FormatException($"The model {nameof(AutonomousDatabasePatch)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabasePatch 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 DeserializeAutonomousDatabasePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabasePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabasePatch.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabasePatch.cs new file mode 100644 index 000000000000..0a6d36756b5c --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabasePatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// The type used for update operations of the AutonomousDatabase. + public partial class AutonomousDatabasePatch + { + /// + /// 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 AutonomousDatabasePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal AutonomousDatabasePatch(IDictionary tags, AutonomousDatabaseUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + public AutonomousDatabaseUpdateProperties Properties { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.Serialization.cs new file mode 100644 index 000000000000..73f135cc6bdd --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.Serialization.cs @@ -0,0 +1,890 @@ +// 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.OracleDatabase.Models +{ + public partial class AutonomousDatabaseProperties : 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(AutonomousDatabaseProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + AutonomousDatabaseProperties 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(AutonomousDatabaseProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseProperties(document.RootElement, options); + } + + internal static AutonomousDatabaseProperties DeserializeAutonomousDatabaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string adminPassword = default; + DataBaseType dataBaseType = default; + AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = default; + string characterSet = default; + float? computeCount = default; + ComputeModel? computeModel = default; + int? cpuCoreCount = default; + IList customerContacts = default; + int? dataStorageSizeInTbs = default; + int? dataStorageSizeInGbs = default; + string dbVersion = default; + WorkloadType? dbWorkload = default; + string displayName = default; + bool? isAutoScalingEnabled = default; + bool? isAutoScalingForStorageEnabled = default; + IReadOnlyList peerDbIds = default; + string peerDbId = default; + bool? isLocalDataGuardEnabled = default; + bool? isRemoteDataGuardEnabled = default; + DisasterRecoveryType? localDisasterRecoveryType = default; + DateTimeOffset? timeDisasterRecoveryRoleChanged = default; + DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = default; + AutonomousDatabaseStandbySummary localStandbyDb = default; + int? failedDataRecoveryInSeconds = default; + bool? isMtlsConnectionRequired = default; + bool? isPreviewVersionWithServiceTermsAccepted = default; + LicenseModel? licenseModel = default; + string ncharacterSet = default; + string lifecycleDetails = default; + AzureResourceProvisioningState? provisioningState = default; + AutonomousDatabaseLifecycleState? lifecycleState = default; + ScheduledOperationsType scheduledOperations = default; + string privateEndpointIP = default; + string privateEndpointLabel = default; + string ociUrl = default; + ResourceIdentifier subnetId = default; + ResourceIdentifier vnetId = default; + DateTimeOffset? timeCreated = default; + DateTimeOffset? timeMaintenanceBegin = default; + DateTimeOffset? timeMaintenanceEnd = default; + double? actualUsedDataStorageSizeInTbs = default; + double? allocatedStorageSizeInTbs = default; + ApexDetailsType apexDetails = default; + IReadOnlyList availableUpgradeVersions = default; + ConnectionStringType connectionStrings = default; + ConnectionUrlType connectionUrls = default; + DataSafeStatusType? dataSafeStatus = default; + DatabaseEditionType? databaseEdition = default; + ResourceIdentifier autonomousDatabaseId = default; + int? inMemoryAreaInGbs = default; + DateTimeOffset? nextLongTermBackupTimeStamp = default; + LongTermBackUpScheduleDetails longTermBackupSchedule = default; + bool? isPreview = default; + int? localAdgAutoFailoverMaxDataLossLimit = default; + int? memoryPerOracleComputeUnitInGbs = default; + OpenModeType? openMode = default; + OperationsInsightsStatusType? operationsInsightsStatus = default; + PermissionLevelType? permissionLevel = default; + string privateEndpoint = default; + IReadOnlyList provisionableCpus = default; + RoleType? role = default; + string serviceConsoleUrl = default; + string sqlWebDeveloperUrl = default; + IReadOnlyList supportedRegionsToCloneTo = default; + string timeDataGuardRoleChanged = default; + string timeDeletionOfFreeAutonomousDatabase = default; + string timeLocalDataGuardEnabled = default; + string timeOfLastFailover = default; + string timeOfLastRefresh = default; + string timeOfLastRefreshPoint = default; + string timeOfLastSwitchover = default; + string timeReclamationOfFreeAutonomousDatabase = default; + int? usedDataStorageSizeInGbs = default; + int? usedDataStorageSizeInTbs = default; + string ocid = default; + int? backupRetentionPeriodInDays = default; + IList whitelistedIPs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("adminPassword"u8)) + { + adminPassword = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataBaseType"u8)) + { + dataBaseType = new DataBaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autonomousMaintenanceScheduleType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousMaintenanceScheduleType = new AutonomousMaintenanceScheduleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("characterSet"u8)) + { + characterSet = property.Value.GetString(); + continue; + } + if (property.NameEquals("computeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeCount = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new ComputeModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("cpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("customerContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CustomerContact.DeserializeCustomerContact(item, options)); + } + customerContacts = array; + continue; + } + if (property.NameEquals("dataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dbVersion"u8)) + { + dbVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("dbWorkload"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbWorkload = new WorkloadType(property.Value.GetString()); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isAutoScalingEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isAutoScalingForStorageEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingForStorageEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("peerDbIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + peerDbIds = array; + continue; + } + if (property.NameEquals("peerDbId"u8)) + { + peerDbId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isLocalDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isLocalDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isRemoteDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isRemoteDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("localDisasterRecoveryType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localDisasterRecoveryType = new DisasterRecoveryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeDisasterRecoveryRoleChanged"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeDisasterRecoveryRoleChanged = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("remoteDisasterRecoveryConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remoteDisasterRecoveryConfiguration = DisasterRecoveryConfigurationDetails.DeserializeDisasterRecoveryConfigurationDetails(property.Value, options); + continue; + } + if (property.NameEquals("localStandbyDb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localStandbyDb = AutonomousDatabaseStandbySummary.DeserializeAutonomousDatabaseStandbySummary(property.Value, options); + continue; + } + if (property.NameEquals("failedDataRecoveryInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failedDataRecoveryInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isMtlsConnectionRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMtlsConnectionRequired = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isPreviewVersionWithServiceTermsAccepted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPreviewVersionWithServiceTermsAccepted = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("licenseModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + licenseModel = new LicenseModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("ncharacterSet"u8)) + { + ncharacterSet = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new AutonomousDatabaseLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("scheduledOperations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledOperations = ScheduledOperationsType.DeserializeScheduledOperationsType(property.Value, options); + continue; + } + if (property.NameEquals("privateEndpointIp"u8)) + { + privateEndpointIP = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateEndpointLabel"u8)) + { + privateEndpointLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("ociUrl"u8)) + { + ociUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceBegin"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceBegin = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceEnd"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceEnd = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("actualUsedDataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + actualUsedDataStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("allocatedStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocatedStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("apexDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + apexDetails = ApexDetailsType.DeserializeApexDetailsType(property.Value, options); + continue; + } + if (property.NameEquals("availableUpgradeVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableUpgradeVersions = array; + continue; + } + if (property.NameEquals("connectionStrings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionStrings = ConnectionStringType.DeserializeConnectionStringType(property.Value, options); + continue; + } + if (property.NameEquals("connectionUrls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionUrls = ConnectionUrlType.DeserializeConnectionUrlType(property.Value, options); + continue; + } + if (property.NameEquals("dataSafeStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataSafeStatus = new DataSafeStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseEdition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseEdition = new DatabaseEditionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autonomousDatabaseId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousDatabaseId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("inMemoryAreaInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inMemoryAreaInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nextLongTermBackupTimeStamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLongTermBackupTimeStamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("longTermBackupSchedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + longTermBackupSchedule = LongTermBackUpScheduleDetails.DeserializeLongTermBackUpScheduleDetails(property.Value, options); + continue; + } + if (property.NameEquals("isPreview"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPreview = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("localAdgAutoFailoverMaxDataLossLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localAdgAutoFailoverMaxDataLossLimit = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("memoryPerOracleComputeUnitInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memoryPerOracleComputeUnitInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("openMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + openMode = new OpenModeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("operationsInsightsStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operationsInsightsStatus = new OperationsInsightsStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("permissionLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + permissionLevel = new PermissionLevelType(property.Value.GetString()); + continue; + } + if (property.NameEquals("privateEndpoint"u8)) + { + privateEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisionableCpus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + provisionableCpus = array; + continue; + } + if (property.NameEquals("role"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + role = new RoleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceConsoleUrl"u8)) + { + serviceConsoleUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("sqlWebDeveloperUrl"u8)) + { + sqlWebDeveloperUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("supportedRegionsToCloneTo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + supportedRegionsToCloneTo = array; + continue; + } + if (property.NameEquals("timeDataGuardRoleChanged"u8)) + { + timeDataGuardRoleChanged = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeDeletionOfFreeAutonomousDatabase"u8)) + { + timeDeletionOfFreeAutonomousDatabase = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeLocalDataGuardEnabled"u8)) + { + timeLocalDataGuardEnabled = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastFailover"u8)) + { + timeOfLastFailover = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastRefresh"u8)) + { + timeOfLastRefresh = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastRefreshPoint"u8)) + { + timeOfLastRefreshPoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastSwitchover"u8)) + { + timeOfLastSwitchover = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeReclamationOfFreeAutonomousDatabase"u8)) + { + timeReclamationOfFreeAutonomousDatabase = property.Value.GetString(); + continue; + } + if (property.NameEquals("usedDataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedDataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("usedDataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedDataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("backupRetentionPeriodInDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backupRetentionPeriodInDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("whitelistedIps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + whitelistedIPs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutonomousDatabaseProperties( + adminPassword, + dataBaseType, + autonomousMaintenanceScheduleType, + characterSet, + computeCount, + computeModel, + cpuCoreCount, + customerContacts ?? new ChangeTrackingList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + dbVersion, + dbWorkload, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDbIds ?? new ChangeTrackingList(), + peerDbId, + isLocalDataGuardEnabled, + isRemoteDataGuardEnabled, + localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, + localStandbyDb, + failedDataRecoveryInSeconds, + isMtlsConnectionRequired, + isPreviewVersionWithServiceTermsAccepted, + licenseModel, + ncharacterSet, + lifecycleDetails, + provisioningState, + lifecycleState, + scheduledOperations, + privateEndpointIP, + privateEndpointLabel, + ociUrl, + subnetId, + vnetId, + timeCreated, + timeMaintenanceBegin, + timeMaintenanceEnd, + actualUsedDataStorageSizeInTbs, + allocatedStorageSizeInTbs, + apexDetails, + availableUpgradeVersions ?? new ChangeTrackingList(), + connectionStrings, + connectionUrls, + dataSafeStatus, + databaseEdition, + autonomousDatabaseId, + inMemoryAreaInGbs, + nextLongTermBackupTimeStamp, + longTermBackupSchedule, + isPreview, + localAdgAutoFailoverMaxDataLossLimit, + memoryPerOracleComputeUnitInGbs, + openMode, + operationsInsightsStatus, + permissionLevel, + privateEndpoint, + provisionableCpus ?? new ChangeTrackingList(), + role, + serviceConsoleUrl, + sqlWebDeveloperUrl, + supportedRegionsToCloneTo ?? new ChangeTrackingList(), + timeDataGuardRoleChanged, + timeDeletionOfFreeAutonomousDatabase, + timeLocalDataGuardEnabled, + timeOfLastFailover, + timeOfLastRefresh, + timeOfLastRefreshPoint, + timeOfLastSwitchover, + timeReclamationOfFreeAutonomousDatabase, + usedDataStorageSizeInGbs, + usedDataStorageSizeInTbs, + ocid, + backupRetentionPeriodInDays, + whitelistedIPs ?? 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); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseProperties)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseProperties 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 DeserializeAutonomousDatabaseProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.cs new file mode 100644 index 000000000000..eb1270799c00 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseProperties.cs @@ -0,0 +1,107 @@ +// 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.OracleDatabase.Models +{ + /// Autonomous Database resource model. + public partial class AutonomousDatabaseProperties : AutonomousDatabaseBaseProperties + { + /// Initializes a new instance of . + public AutonomousDatabaseProperties() + { + DataBaseType = DataBaseType.Regular; + } + + /// Initializes a new instance of . + /// Admin password. + /// Database type to be created. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// Keeps track of any properties unknown to the library. + internal AutonomousDatabaseProperties(string adminPassword, DataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, ComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, WorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDbIds, string peerDbId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, DateTimeOffset? timeDisasterRecoveryRoleChanged, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration, AutonomousDatabaseStandbySummary localStandbyDb, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, LicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, AzureResourceProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, string ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? timeCreated, DateTimeOffset? timeMaintenanceBegin, DateTimeOffset? timeMaintenanceEnd, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, ApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, ConnectionStringType connectionStrings, ConnectionUrlType connectionUrls, DataSafeStatusType? dataSafeStatus, DatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupTimeStamp, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, OpenModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, PermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, RoleType? role, string serviceConsoleUri, string sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, string timeDataGuardRoleChanged, string timeDeletionOfFreeAutonomousDatabase, string timeLocalDataGuardEnabled, string timeOfLastFailover, string timeOfLastRefresh, string timeOfLastRefreshPoint, string timeOfLastSwitchover, string timeReclamationOfFreeAutonomousDatabase, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, string ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData) : base(adminPassword, dataBaseType, autonomousMaintenanceScheduleType, characterSet, computeCount, computeModel, cpuCoreCount, customerContacts, dataStorageSizeInTbs, dataStorageSizeInGbs, dbVersion, dbWorkload, displayName, isAutoScalingEnabled, isAutoScalingForStorageEnabled, peerDbIds, peerDbId, isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, timeDisasterRecoveryRoleChanged, remoteDisasterRecoveryConfiguration, localStandbyDb, failedDataRecoveryInSeconds, isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted, licenseModel, ncharacterSet, lifecycleDetails, provisioningState, lifecycleState, scheduledOperations, privateEndpointIP, privateEndpointLabel, ociUri, subnetId, vnetId, timeCreated, timeMaintenanceBegin, timeMaintenanceEnd, actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs, apexDetails, availableUpgradeVersions, connectionStrings, connectionUrls, dataSafeStatus, databaseEdition, autonomousDatabaseId, inMemoryAreaInGbs, nextLongTermBackupTimeStamp, longTermBackupSchedule, isPreview, localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs, openMode, operationsInsightsStatus, permissionLevel, privateEndpoint, provisionableCpus, role, serviceConsoleUri, sqlWebDeveloperUri, supportedRegionsToCloneTo, timeDataGuardRoleChanged, timeDeletionOfFreeAutonomousDatabase, timeLocalDataGuardEnabled, timeOfLastFailover, timeOfLastRefresh, timeOfLastRefreshPoint, timeOfLastSwitchover, timeReclamationOfFreeAutonomousDatabase, usedDataStorageSizeInGbs, usedDataStorageSizeInTbs, ocid, backupRetentionPeriodInDays, whitelistedIPs, serializedAdditionalRawData) + { + DataBaseType = dataBaseType; + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseStandbySummary.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseStandbySummary.Serialization.cs new file mode 100644 index 000000000000..6bbad99d7295 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseStandbySummary.Serialization.cs @@ -0,0 +1,187 @@ +// 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.OracleDatabase.Models +{ + public partial class AutonomousDatabaseStandbySummary : 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(AutonomousDatabaseStandbySummary)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(LagTimeInSeconds)) + { + writer.WritePropertyName("lagTimeInSeconds"u8); + writer.WriteNumberValue(LagTimeInSeconds.Value); + } + if (Optional.IsDefined(LifecycleState)) + { + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.Value.ToString()); + } + if (Optional.IsDefined(LifecycleDetails)) + { + writer.WritePropertyName("lifecycleDetails"u8); + writer.WriteStringValue(LifecycleDetails); + } + if (Optional.IsDefined(TimeDataGuardRoleChanged)) + { + writer.WritePropertyName("timeDataGuardRoleChanged"u8); + writer.WriteStringValue(TimeDataGuardRoleChanged); + } + if (Optional.IsDefined(TimeDisasterRecoveryRoleChanged)) + { + writer.WritePropertyName("timeDisasterRecoveryRoleChanged"u8); + writer.WriteStringValue(TimeDisasterRecoveryRoleChanged); + } + 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 + } + } + } + + AutonomousDatabaseStandbySummary 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(AutonomousDatabaseStandbySummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseStandbySummary(document.RootElement, options); + } + + internal static AutonomousDatabaseStandbySummary DeserializeAutonomousDatabaseStandbySummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? lagTimeInSeconds = default; + AutonomousDatabaseLifecycleState? lifecycleState = default; + string lifecycleDetails = default; + string timeDataGuardRoleChanged = default; + string timeDisasterRecoveryRoleChanged = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("lagTimeInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lagTimeInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new AutonomousDatabaseLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeDataGuardRoleChanged"u8)) + { + timeDataGuardRoleChanged = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeDisasterRecoveryRoleChanged"u8)) + { + timeDisasterRecoveryRoleChanged = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutonomousDatabaseStandbySummary( + lagTimeInSeconds, + lifecycleState, + lifecycleDetails, + timeDataGuardRoleChanged, + timeDisasterRecoveryRoleChanged, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseStandbySummary)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseStandbySummary 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 DeserializeAutonomousDatabaseStandbySummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseStandbySummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseStandbySummary.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseStandbySummary.cs new file mode 100644 index 000000000000..88416144b1c0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseStandbySummary.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.OracleDatabase.Models +{ + /// Autonomous Disaster Recovery standby database details. + public partial class AutonomousDatabaseStandbySummary + { + /// + /// 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 AutonomousDatabaseStandbySummary() + { + } + + /// Initializes a new instance of . + /// The amount of time, in seconds, that the data of the standby database lags the data of the primary database. Can be used to determine the potential data loss in the event of a failover. + /// The current state of the Autonomous Database. + /// Additional information about the current lifecycle state. + /// The date and time the Autonomous Data Guard role was switched for the standby Autonomous Database. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Keeps track of any properties unknown to the library. + internal AutonomousDatabaseStandbySummary(int? lagTimeInSeconds, AutonomousDatabaseLifecycleState? lifecycleState, string lifecycleDetails, string timeDataGuardRoleChanged, string timeDisasterRecoveryRoleChanged, IDictionary serializedAdditionalRawData) + { + LagTimeInSeconds = lagTimeInSeconds; + LifecycleState = lifecycleState; + LifecycleDetails = lifecycleDetails; + TimeDataGuardRoleChanged = timeDataGuardRoleChanged; + TimeDisasterRecoveryRoleChanged = timeDisasterRecoveryRoleChanged; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The amount of time, in seconds, that the data of the standby database lags the data of the primary database. Can be used to determine the potential data loss in the event of a failover. + public int? LagTimeInSeconds { get; } + /// The current state of the Autonomous Database. + public AutonomousDatabaseLifecycleState? LifecycleState { get; } + /// Additional information about the current lifecycle state. + public string LifecycleDetails { get; } + /// The date and time the Autonomous Data Guard role was switched for the standby Autonomous Database. + public string TimeDataGuardRoleChanged { get; } + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + public string TimeDisasterRecoveryRoleChanged { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseUpdateProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..637518e5791b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseUpdateProperties.Serialization.cs @@ -0,0 +1,495 @@ +// 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.OracleDatabase.Models +{ + public partial class AutonomousDatabaseUpdateProperties : 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(AutonomousDatabaseUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AdminPassword)) + { + writer.WritePropertyName("adminPassword"u8); + writer.WriteStringValue(AdminPassword); + } + if (Optional.IsDefined(AutonomousMaintenanceScheduleType)) + { + writer.WritePropertyName("autonomousMaintenanceScheduleType"u8); + writer.WriteStringValue(AutonomousMaintenanceScheduleType.Value.ToString()); + } + if (Optional.IsDefined(ComputeCount)) + { + writer.WritePropertyName("computeCount"u8); + writer.WriteNumberValue(ComputeCount.Value); + } + if (Optional.IsDefined(CpuCoreCount)) + { + writer.WritePropertyName("cpuCoreCount"u8); + writer.WriteNumberValue(CpuCoreCount.Value); + } + if (Optional.IsCollectionDefined(CustomerContacts)) + { + writer.WritePropertyName("customerContacts"u8); + writer.WriteStartArray(); + foreach (var item in CustomerContacts) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DataStorageSizeInTbs)) + { + writer.WritePropertyName("dataStorageSizeInTbs"u8); + writer.WriteNumberValue(DataStorageSizeInTbs.Value); + } + if (Optional.IsDefined(DataStorageSizeInGbs)) + { + writer.WritePropertyName("dataStorageSizeInGbs"u8); + writer.WriteNumberValue(DataStorageSizeInGbs.Value); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(IsAutoScalingEnabled)) + { + writer.WritePropertyName("isAutoScalingEnabled"u8); + writer.WriteBooleanValue(IsAutoScalingEnabled.Value); + } + if (Optional.IsDefined(IsAutoScalingForStorageEnabled)) + { + writer.WritePropertyName("isAutoScalingForStorageEnabled"u8); + writer.WriteBooleanValue(IsAutoScalingForStorageEnabled.Value); + } + if (Optional.IsDefined(PeerDbId)) + { + writer.WritePropertyName("peerDbId"u8); + writer.WriteStringValue(PeerDbId); + } + if (Optional.IsDefined(IsLocalDataGuardEnabled)) + { + writer.WritePropertyName("isLocalDataGuardEnabled"u8); + writer.WriteBooleanValue(IsLocalDataGuardEnabled.Value); + } + if (Optional.IsDefined(IsMtlsConnectionRequired)) + { + writer.WritePropertyName("isMtlsConnectionRequired"u8); + writer.WriteBooleanValue(IsMtlsConnectionRequired.Value); + } + if (Optional.IsDefined(LicenseModel)) + { + writer.WritePropertyName("licenseModel"u8); + writer.WriteStringValue(LicenseModel.Value.ToString()); + } + if (Optional.IsDefined(ScheduledOperations)) + { + writer.WritePropertyName("scheduledOperations"u8); + writer.WriteObjectValue(ScheduledOperations, options); + } + if (Optional.IsDefined(DatabaseEdition)) + { + writer.WritePropertyName("databaseEdition"u8); + writer.WriteStringValue(DatabaseEdition.Value.ToString()); + } + if (Optional.IsDefined(LongTermBackupSchedule)) + { + writer.WritePropertyName("longTermBackupSchedule"u8); + writer.WriteObjectValue(LongTermBackupSchedule, options); + } + if (Optional.IsDefined(LocalAdgAutoFailoverMaxDataLossLimit)) + { + writer.WritePropertyName("localAdgAutoFailoverMaxDataLossLimit"u8); + writer.WriteNumberValue(LocalAdgAutoFailoverMaxDataLossLimit.Value); + } + if (Optional.IsDefined(OpenMode)) + { + writer.WritePropertyName("openMode"u8); + writer.WriteStringValue(OpenMode.Value.ToString()); + } + if (Optional.IsDefined(PermissionLevel)) + { + writer.WritePropertyName("permissionLevel"u8); + writer.WriteStringValue(PermissionLevel.Value.ToString()); + } + if (Optional.IsDefined(Role)) + { + writer.WritePropertyName("role"u8); + writer.WriteStringValue(Role.Value.ToString()); + } + if (Optional.IsDefined(BackupRetentionPeriodInDays)) + { + writer.WritePropertyName("backupRetentionPeriodInDays"u8); + writer.WriteNumberValue(BackupRetentionPeriodInDays.Value); + } + if (Optional.IsCollectionDefined(WhitelistedIPs)) + { + writer.WritePropertyName("whitelistedIps"u8); + writer.WriteStartArray(); + foreach (var item in WhitelistedIPs) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AutonomousDatabaseUpdateProperties 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(AutonomousDatabaseUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseUpdateProperties(document.RootElement, options); + } + + internal static AutonomousDatabaseUpdateProperties DeserializeAutonomousDatabaseUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string adminPassword = default; + AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = default; + float? computeCount = default; + int? cpuCoreCount = default; + IList customerContacts = default; + int? dataStorageSizeInTbs = default; + int? dataStorageSizeInGbs = default; + string displayName = default; + bool? isAutoScalingEnabled = default; + bool? isAutoScalingForStorageEnabled = default; + string peerDbId = default; + bool? isLocalDataGuardEnabled = default; + bool? isMtlsConnectionRequired = default; + LicenseModel? licenseModel = default; + ScheduledOperationsType scheduledOperations = default; + DatabaseEditionType? databaseEdition = default; + LongTermBackUpScheduleDetails longTermBackupSchedule = default; + int? localAdgAutoFailoverMaxDataLossLimit = default; + OpenModeType? openMode = default; + PermissionLevelType? permissionLevel = default; + RoleType? role = default; + int? backupRetentionPeriodInDays = default; + IList whitelistedIPs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("adminPassword"u8)) + { + adminPassword = property.Value.GetString(); + continue; + } + if (property.NameEquals("autonomousMaintenanceScheduleType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousMaintenanceScheduleType = new AutonomousMaintenanceScheduleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("computeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeCount = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("cpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("customerContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CustomerContact.DeserializeCustomerContact(item, options)); + } + customerContacts = array; + continue; + } + if (property.NameEquals("dataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isAutoScalingEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isAutoScalingForStorageEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingForStorageEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("peerDbId"u8)) + { + peerDbId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isLocalDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isLocalDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isMtlsConnectionRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMtlsConnectionRequired = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("licenseModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + licenseModel = new LicenseModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("scheduledOperations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledOperations = ScheduledOperationsType.DeserializeScheduledOperationsType(property.Value, options); + continue; + } + if (property.NameEquals("databaseEdition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseEdition = new DatabaseEditionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("longTermBackupSchedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + longTermBackupSchedule = LongTermBackUpScheduleDetails.DeserializeLongTermBackUpScheduleDetails(property.Value, options); + continue; + } + if (property.NameEquals("localAdgAutoFailoverMaxDataLossLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localAdgAutoFailoverMaxDataLossLimit = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("openMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + openMode = new OpenModeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("permissionLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + permissionLevel = new PermissionLevelType(property.Value.GetString()); + continue; + } + if (property.NameEquals("role"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + role = new RoleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("backupRetentionPeriodInDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backupRetentionPeriodInDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("whitelistedIps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + whitelistedIPs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutonomousDatabaseUpdateProperties( + adminPassword, + autonomousMaintenanceScheduleType, + computeCount, + cpuCoreCount, + customerContacts ?? new ChangeTrackingList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDbId, + isLocalDataGuardEnabled, + isMtlsConnectionRequired, + licenseModel, + scheduledOperations, + databaseEdition, + longTermBackupSchedule, + localAdgAutoFailoverMaxDataLossLimit, + openMode, + permissionLevel, + role, + backupRetentionPeriodInDays, + whitelistedIPs ?? 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); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseUpdateProperties 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 DeserializeAutonomousDatabaseUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseUpdateProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseUpdateProperties.cs new file mode 100644 index 000000000000..92be925ac4ac --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseUpdateProperties.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// The updatable properties of the AutonomousDatabase. + public partial class AutonomousDatabaseUpdateProperties + { + /// + /// 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 AutonomousDatabaseUpdateProperties() + { + CustomerContacts = new ChangeTrackingList(); + WhitelistedIPs = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Admin password. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The compute amount (CPUs) available to the database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Specifies if the Autonomous Database requires mTLS connections. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The list of scheduled operations. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Details for the long-term backup schedule. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// Indicates the Autonomous Database mode. + /// The Autonomous Database permission level. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// Keeps track of any properties unknown to the library. + internal AutonomousDatabaseUpdateProperties(string adminPassword, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, float? computeCount, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, string peerDbId, bool? isLocalDataGuardEnabled, bool? isMtlsConnectionRequired, LicenseModel? licenseModel, ScheduledOperationsType scheduledOperations, DatabaseEditionType? databaseEdition, LongTermBackUpScheduleDetails longTermBackupSchedule, int? localAdgAutoFailoverMaxDataLossLimit, OpenModeType? openMode, PermissionLevelType? permissionLevel, RoleType? role, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData) + { + AdminPassword = adminPassword; + AutonomousMaintenanceScheduleType = autonomousMaintenanceScheduleType; + ComputeCount = computeCount; + CpuCoreCount = cpuCoreCount; + CustomerContacts = customerContacts; + DataStorageSizeInTbs = dataStorageSizeInTbs; + DataStorageSizeInGbs = dataStorageSizeInGbs; + DisplayName = displayName; + IsAutoScalingEnabled = isAutoScalingEnabled; + IsAutoScalingForStorageEnabled = isAutoScalingForStorageEnabled; + PeerDbId = peerDbId; + IsLocalDataGuardEnabled = isLocalDataGuardEnabled; + IsMtlsConnectionRequired = isMtlsConnectionRequired; + LicenseModel = licenseModel; + ScheduledOperations = scheduledOperations; + DatabaseEdition = databaseEdition; + LongTermBackupSchedule = longTermBackupSchedule; + LocalAdgAutoFailoverMaxDataLossLimit = localAdgAutoFailoverMaxDataLossLimit; + OpenMode = openMode; + PermissionLevel = permissionLevel; + Role = role; + BackupRetentionPeriodInDays = backupRetentionPeriodInDays; + WhitelistedIPs = whitelistedIPs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Admin password. + public string AdminPassword { get; set; } + /// The maintenance schedule type of the Autonomous Database Serverless. + public AutonomousMaintenanceScheduleType? AutonomousMaintenanceScheduleType { get; set; } + /// The compute amount (CPUs) available to the database. + public float? ComputeCount { get; set; } + /// The number of CPU cores to be made available to the database. + public int? CpuCoreCount { get; set; } + /// Customer Contacts. + public IList CustomerContacts { get; } + /// The quantity of data in the database, in terabytes. + public int? DataStorageSizeInTbs { get; set; } + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + public int? DataStorageSizeInGbs { get; set; } + /// The user-friendly name for the Autonomous Database. + public string DisplayName { get; set; } + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + public bool? IsAutoScalingEnabled { get; set; } + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + public bool? IsAutoScalingForStorageEnabled { get; set; } + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + public string PeerDbId { get; set; } + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + public bool? IsLocalDataGuardEnabled { get; set; } + /// Specifies if the Autonomous Database requires mTLS connections. + public bool? IsMtlsConnectionRequired { get; set; } + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + public LicenseModel? LicenseModel { get; set; } + /// The list of scheduled operations. + public ScheduledOperationsType ScheduledOperations { get; set; } + /// The Oracle Database Edition that applies to the Autonomous databases. + public DatabaseEditionType? DatabaseEdition { get; set; } + /// Details for the long-term backup schedule. + public LongTermBackUpScheduleDetails LongTermBackupSchedule { get; set; } + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + public int? LocalAdgAutoFailoverMaxDataLossLimit { get; set; } + /// Indicates the Autonomous Database mode. + public OpenModeType? OpenMode { get; set; } + /// The Autonomous Database permission level. + public PermissionLevelType? PermissionLevel { get; set; } + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + public RoleType? Role { get; set; } + /// Retention period, in days, for long-term backups. + public int? BackupRetentionPeriodInDays { get; set; } + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + public IList WhitelistedIPs { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseWalletFile.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseWalletFile.Serialization.cs new file mode 100644 index 000000000000..8ab6d2f3207b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseWalletFile.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.OracleDatabase.Models +{ + public partial class AutonomousDatabaseWalletFile : 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(AutonomousDatabaseWalletFile)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("walletFiles"u8); + writer.WriteStringValue(WalletFiles); + 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 + } + } + } + + AutonomousDatabaseWalletFile 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(AutonomousDatabaseWalletFile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseWalletFile(document.RootElement, options); + } + + internal static AutonomousDatabaseWalletFile DeserializeAutonomousDatabaseWalletFile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string walletFiles = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("walletFiles"u8)) + { + walletFiles = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutonomousDatabaseWalletFile(walletFiles, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseWalletFile)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseWalletFile 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 DeserializeAutonomousDatabaseWalletFile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseWalletFile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseWalletFile.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseWalletFile.cs new file mode 100644 index 000000000000..c46f2b318484 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseWalletFile.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.OracleDatabase.Models +{ + /// Autonomous Database Wallet File resource model. + public partial class AutonomousDatabaseWalletFile + { + /// + /// 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 base64 encoded wallet files. + /// is null. + internal AutonomousDatabaseWalletFile(string walletFiles) + { + Argument.AssertNotNull(walletFiles, nameof(walletFiles)); + + WalletFiles = walletFiles; + } + + /// Initializes a new instance of . + /// The base64 encoded wallet files. + /// Keeps track of any properties unknown to the library. + internal AutonomousDatabaseWalletFile(string walletFiles, IDictionary serializedAdditionalRawData) + { + WalletFiles = walletFiles; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDatabaseWalletFile() + { + } + + /// The base64 encoded wallet files. + public string WalletFiles { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionListResult.Serialization.cs new file mode 100644 index 000000000000..f8f1d9445ce0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionListResult.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.OracleDatabase.Models +{ + internal partial class AutonomousDbVersionListResult : 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(AutonomousDbVersionListResult)} 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 + } + } + } + + AutonomousDbVersionListResult 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(AutonomousDbVersionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDbVersionListResult(document.RootElement, options); + } + + internal static AutonomousDbVersionListResult DeserializeAutonomousDbVersionListResult(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(AutonomousDbVersionData.DeserializeAutonomousDbVersionData(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 AutonomousDbVersionListResult(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); + default: + throw new FormatException($"The model {nameof(AutonomousDbVersionListResult)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDbVersionListResult 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 DeserializeAutonomousDbVersionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDbVersionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionListResult.cs new file mode 100644 index 000000000000..1e0dd60610f3 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionListResult.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.OracleDatabase.Models +{ + /// The response of a AutonomousDbVersion list operation. + internal partial class AutonomousDbVersionListResult + { + /// + /// 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 AutonomousDbVersion items on this page. + /// is null. + internal AutonomousDbVersionListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AutonomousDbVersion items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AutonomousDbVersionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDbVersionListResult() + { + } + + /// The AutonomousDbVersion items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionProperties.Serialization.cs new file mode 100644 index 000000000000..b4b12822a112 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionProperties.Serialization.cs @@ -0,0 +1,208 @@ +// 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.OracleDatabase.Models +{ + public partial class AutonomousDbVersionProperties : 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(AutonomousDbVersionProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + if (Optional.IsDefined(DbWorkload)) + { + writer.WritePropertyName("dbWorkload"u8); + writer.WriteStringValue(DbWorkload.Value.ToString()); + } + if (Optional.IsDefined(IsDefaultForFree)) + { + writer.WritePropertyName("isDefaultForFree"u8); + writer.WriteBooleanValue(IsDefaultForFree.Value); + } + if (Optional.IsDefined(IsDefaultForPaid)) + { + writer.WritePropertyName("isDefaultForPaid"u8); + writer.WriteBooleanValue(IsDefaultForPaid.Value); + } + if (Optional.IsDefined(IsFreeTierEnabled)) + { + writer.WritePropertyName("isFreeTierEnabled"u8); + writer.WriteBooleanValue(IsFreeTierEnabled.Value); + } + if (Optional.IsDefined(IsPaidEnabled)) + { + writer.WritePropertyName("isPaidEnabled"u8); + writer.WriteBooleanValue(IsPaidEnabled.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 + } + } + } + + AutonomousDbVersionProperties 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(AutonomousDbVersionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDbVersionProperties(document.RootElement, options); + } + + internal static AutonomousDbVersionProperties DeserializeAutonomousDbVersionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string version = default; + WorkloadType? dbWorkload = default; + bool? isDefaultForFree = default; + bool? isDefaultForPaid = default; + bool? isFreeTierEnabled = default; + bool? isPaidEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("dbWorkload"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbWorkload = new WorkloadType(property.Value.GetString()); + continue; + } + if (property.NameEquals("isDefaultForFree"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDefaultForFree = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isDefaultForPaid"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDefaultForPaid = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isFreeTierEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isFreeTierEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isPaidEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPaidEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutonomousDbVersionProperties( + version, + dbWorkload, + isDefaultForFree, + isDefaultForPaid, + isFreeTierEnabled, + isPaidEnabled, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutonomousDbVersionProperties)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDbVersionProperties 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 DeserializeAutonomousDbVersionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDbVersionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionProperties.cs new file mode 100644 index 000000000000..ba70a7ad559a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDbVersionProperties.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.OracleDatabase.Models +{ + /// AutonomousDbVersion resource model. + public partial class AutonomousDbVersionProperties + { + /// + /// 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 . + /// Supported Autonomous Db versions. + /// is null. + internal AutonomousDbVersionProperties(string version) + { + Argument.AssertNotNull(version, nameof(version)); + + Version = version; + } + + /// Initializes a new instance of . + /// Supported Autonomous Db versions. + /// The Autonomous Database workload type. + /// True if this version of the Oracle Database software's default is free. + /// True if this version of the Oracle Database software's default is paid. + /// True if this version of the Oracle Database software can be used for Always-Free Autonomous Databases. + /// True if this version of the Oracle Database software has payments enabled. + /// Keeps track of any properties unknown to the library. + internal AutonomousDbVersionProperties(string version, WorkloadType? dbWorkload, bool? isDefaultForFree, bool? isDefaultForPaid, bool? isFreeTierEnabled, bool? isPaidEnabled, IDictionary serializedAdditionalRawData) + { + Version = version; + DbWorkload = dbWorkload; + IsDefaultForFree = isDefaultForFree; + IsDefaultForPaid = isDefaultForPaid; + IsFreeTierEnabled = isFreeTierEnabled; + IsPaidEnabled = isPaidEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutonomousDbVersionProperties() + { + } + + /// Supported Autonomous Db versions. + public string Version { get; } + /// The Autonomous Database workload type. + public WorkloadType? DbWorkload { get; } + /// True if this version of the Oracle Database software's default is free. + public bool? IsDefaultForFree { get; } + /// True if this version of the Oracle Database software's default is paid. + public bool? IsDefaultForPaid { get; } + /// True if this version of the Oracle Database software can be used for Always-Free Autonomous Databases. + public bool? IsFreeTierEnabled { get; } + /// True if this version of the Oracle Database software has payments enabled. + public bool? IsPaidEnabled { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousMaintenanceScheduleType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousMaintenanceScheduleType.cs new file mode 100644 index 000000000000..3a445168a667 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousMaintenanceScheduleType.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.OracleDatabase.Models +{ + /// Autonomous database maintenance schedule type enum. + public readonly partial struct AutonomousMaintenanceScheduleType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutonomousMaintenanceScheduleType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EarlyValue = "Early"; + private const string RegularValue = "Regular"; + + /// Early maintenance schedule. + public static AutonomousMaintenanceScheduleType Early { get; } = new AutonomousMaintenanceScheduleType(EarlyValue); + /// Regular maintenance schedule. + public static AutonomousMaintenanceScheduleType Regular { get; } = new AutonomousMaintenanceScheduleType(RegularValue); + /// Determines if two values are the same. + public static bool operator ==(AutonomousMaintenanceScheduleType left, AutonomousMaintenanceScheduleType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutonomousMaintenanceScheduleType left, AutonomousMaintenanceScheduleType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutonomousMaintenanceScheduleType(string value) => new AutonomousMaintenanceScheduleType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutonomousMaintenanceScheduleType other && Equals(other); + /// + public bool Equals(AutonomousMaintenanceScheduleType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureResourceProvisioningState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureResourceProvisioningState.cs new file mode 100644 index 000000000000..3b2c466b3695 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureResourceProvisioningState.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.OracleDatabase.Models +{ + /// Azure Resource Provisioning State enum. + public readonly partial struct AzureResourceProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureResourceProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + + /// Resource has been created. + public static AzureResourceProvisioningState Succeeded { get; } = new AzureResourceProvisioningState(SucceededValue); + /// Resource creation failed. + public static AzureResourceProvisioningState Failed { get; } = new AzureResourceProvisioningState(FailedValue); + /// Resource creation was canceled. + public static AzureResourceProvisioningState Canceled { get; } = new AzureResourceProvisioningState(CanceledValue); + /// Indicates that resource in Provisioning state. + public static AzureResourceProvisioningState Provisioning { get; } = new AzureResourceProvisioningState(ProvisioningValue); + /// Determines if two values are the same. + public static bool operator ==(AzureResourceProvisioningState left, AzureResourceProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureResourceProvisioningState left, AzureResourceProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureResourceProvisioningState(string value) => new AzureResourceProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureResourceProvisioningState other && Equals(other); + /// + public bool Equals(AzureResourceProvisioningState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.Serialization.cs new file mode 100644 index 000000000000..0a566c92b8c3 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + public partial class AzureSubscriptions : 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(AzureSubscriptions)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("azureSubscriptionIds"u8); + writer.WriteStartArray(); + foreach (var item in AzureSubscriptionIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureSubscriptions 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(AzureSubscriptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureSubscriptions(document.RootElement, options); + } + + internal static AzureSubscriptions DeserializeAzureSubscriptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList azureSubscriptionIds = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azureSubscriptionIds"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + azureSubscriptionIds = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureSubscriptions(azureSubscriptionIds, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureSubscriptions)} does not support writing '{options.Format}' format."); + } + } + + AzureSubscriptions 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 DeserializeAzureSubscriptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureSubscriptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.cs new file mode 100644 index 000000000000..4fc171c10996 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AzureSubscriptions.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 System.Linq; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Azure Subscriptions model. + public partial class AzureSubscriptions + { + /// + /// 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 . + /// Azure Subscription Ids to be updated. + /// is null. + public AzureSubscriptions(IEnumerable azureSubscriptionIds) + { + Argument.AssertNotNull(azureSubscriptionIds, nameof(azureSubscriptionIds)); + + AzureSubscriptionIds = azureSubscriptionIds.ToList(); + } + + /// Initializes a new instance of . + /// Azure Subscription Ids to be updated. + /// Keeps track of any properties unknown to the library. + internal AzureSubscriptions(IList azureSubscriptionIds, IDictionary serializedAdditionalRawData) + { + AzureSubscriptionIds = azureSubscriptionIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureSubscriptions() + { + } + + /// Azure Subscription Ids to be updated. + public IList AzureSubscriptionIds { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloneType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloneType.cs new file mode 100644 index 000000000000..db6ecc558ea3 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloneType.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.OracleDatabase.Models +{ + /// Clone type enum. + public readonly partial struct CloneType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CloneType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FullValue = "Full"; + private const string MetadataValue = "Metadata"; + + /// Full clone. + public static CloneType Full { get; } = new CloneType(FullValue); + /// Metadata only. + public static CloneType Metadata { get; } = new CloneType(MetadataValue); + /// Determines if two values are the same. + public static bool operator ==(CloneType left, CloneType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CloneType left, CloneType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CloneType(string value) => new CloneType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CloneType other && Equals(other); + /// + public bool Equals(CloneType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudAccountProvisioningState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudAccountProvisioningState.cs new file mode 100644 index 000000000000..36382281a4c2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudAccountProvisioningState.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.OracleDatabase.Models +{ + /// CloudAccountProvisioningState enum. + public readonly partial struct CloudAccountProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CloudAccountProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string ProvisioningValue = "Provisioning"; + private const string AvailableValue = "Available"; + + /// Pending - Initial state when Oracle cloud account is not configured. + public static CloudAccountProvisioningState Pending { get; } = new CloudAccountProvisioningState(PendingValue); + /// Provisioning - State when Oracle cloud account is being provisioned. + public static CloudAccountProvisioningState Provisioning { get; } = new CloudAccountProvisioningState(ProvisioningValue); + /// Available - State when Oracle cloud account cloud linking is complete and it is available. + public static CloudAccountProvisioningState Available { get; } = new CloudAccountProvisioningState(AvailableValue); + /// Determines if two values are the same. + public static bool operator ==(CloudAccountProvisioningState left, CloudAccountProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CloudAccountProvisioningState left, CloudAccountProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CloudAccountProvisioningState(string value) => new CloudAccountProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CloudAccountProvisioningState other && Equals(other); + /// + public bool Equals(CloudAccountProvisioningState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureLifecycleState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureLifecycleState.cs new file mode 100644 index 000000000000..8146d7488fe9 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureLifecycleState.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.OracleDatabase.Models +{ + /// CloudExadataInfrastructureLifecycleState enum. + public readonly partial struct CloudExadataInfrastructureLifecycleState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CloudExadataInfrastructureLifecycleState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProvisioningValue = "Provisioning"; + private const string AvailableValue = "Available"; + private const string UpdatingValue = "Updating"; + private const string TerminatingValue = "Terminating"; + private const string TerminatedValue = "Terminated"; + private const string MaintenanceInProgressValue = "MaintenanceInProgress"; + private const string FailedValue = "Failed"; + + /// Indicates that resource in Provisioning state. + public static CloudExadataInfrastructureLifecycleState Provisioning { get; } = new CloudExadataInfrastructureLifecycleState(ProvisioningValue); + /// Indicates that resource in Available state. + public static CloudExadataInfrastructureLifecycleState Available { get; } = new CloudExadataInfrastructureLifecycleState(AvailableValue); + /// Indicates that resource in Updating state. + public static CloudExadataInfrastructureLifecycleState Updating { get; } = new CloudExadataInfrastructureLifecycleState(UpdatingValue); + /// Indicates that resource in Terminating state. + public static CloudExadataInfrastructureLifecycleState Terminating { get; } = new CloudExadataInfrastructureLifecycleState(TerminatingValue); + /// Indicates that resource in Terminated state. + public static CloudExadataInfrastructureLifecycleState Terminated { get; } = new CloudExadataInfrastructureLifecycleState(TerminatedValue); + /// Indicates that resource maintenance in progress state. + public static CloudExadataInfrastructureLifecycleState MaintenanceInProgress { get; } = new CloudExadataInfrastructureLifecycleState(MaintenanceInProgressValue); + /// Indicates that resource in Failed state. + public static CloudExadataInfrastructureLifecycleState Failed { get; } = new CloudExadataInfrastructureLifecycleState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(CloudExadataInfrastructureLifecycleState left, CloudExadataInfrastructureLifecycleState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CloudExadataInfrastructureLifecycleState left, CloudExadataInfrastructureLifecycleState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CloudExadataInfrastructureLifecycleState(string value) => new CloudExadataInfrastructureLifecycleState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CloudExadataInfrastructureLifecycleState other && Equals(other); + /// + public bool Equals(CloudExadataInfrastructureLifecycleState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureListResult.Serialization.cs new file mode 100644 index 000000000000..ee334679aed9 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureListResult.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.OracleDatabase.Models +{ + internal partial class CloudExadataInfrastructureListResult : 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(CloudExadataInfrastructureListResult)} 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 + } + } + } + + CloudExadataInfrastructureListResult 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(CloudExadataInfrastructureListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudExadataInfrastructureListResult(document.RootElement, options); + } + + internal static CloudExadataInfrastructureListResult DeserializeCloudExadataInfrastructureListResult(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(CloudExadataInfrastructureData.DeserializeCloudExadataInfrastructureData(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 CloudExadataInfrastructureListResult(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); + default: + throw new FormatException($"The model {nameof(CloudExadataInfrastructureListResult)} does not support writing '{options.Format}' format."); + } + } + + CloudExadataInfrastructureListResult 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 DeserializeCloudExadataInfrastructureListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CloudExadataInfrastructureListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureListResult.cs new file mode 100644 index 000000000000..e7dc1dc9f850 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureListResult.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.OracleDatabase.Models +{ + /// The response of a CloudExadataInfrastructure list operation. + internal partial class CloudExadataInfrastructureListResult + { + /// + /// 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 CloudExadataInfrastructure items on this page. + /// is null. + internal CloudExadataInfrastructureListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The CloudExadataInfrastructure items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal CloudExadataInfrastructureListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CloudExadataInfrastructureListResult() + { + } + + /// The CloudExadataInfrastructure items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructurePatch.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructurePatch.Serialization.cs new file mode 100644 index 000000000000..669e33c777af --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructurePatch.Serialization.cs @@ -0,0 +1,184 @@ +// 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.OracleDatabase.Models +{ + public partial class CloudExadataInfrastructurePatch : 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(CloudExadataInfrastructurePatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Zones)) + { + writer.WritePropertyName("zones"u8); + writer.WriteStartArray(); + foreach (var item in Zones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + 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 (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 + } + } + } + + CloudExadataInfrastructurePatch 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(CloudExadataInfrastructurePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudExadataInfrastructurePatch(document.RootElement, options); + } + + internal static CloudExadataInfrastructurePatch DeserializeCloudExadataInfrastructurePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList zones = default; + IDictionary tags = default; + CloudExadataInfrastructureUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("zones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; + 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("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = CloudExadataInfrastructureUpdateProperties.DeserializeCloudExadataInfrastructureUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CloudExadataInfrastructurePatch(zones ?? new ChangeTrackingList(), 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); + default: + throw new FormatException($"The model {nameof(CloudExadataInfrastructurePatch)} does not support writing '{options.Format}' format."); + } + } + + CloudExadataInfrastructurePatch 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 DeserializeCloudExadataInfrastructurePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CloudExadataInfrastructurePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructurePatch.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructurePatch.cs new file mode 100644 index 000000000000..42364e92eec8 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructurePatch.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.OracleDatabase.Models +{ + /// The type used for update operations of the CloudExadataInfrastructure. + public partial class CloudExadataInfrastructurePatch + { + /// + /// 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 CloudExadataInfrastructurePatch() + { + Zones = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// CloudExadataInfrastructure zones. + /// Resource tags. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal CloudExadataInfrastructurePatch(IList zones, IDictionary tags, CloudExadataInfrastructureUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Zones = zones; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// CloudExadataInfrastructure zones. + public IList Zones { get; } + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + public CloudExadataInfrastructureUpdateProperties Properties { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.Serialization.cs new file mode 100644 index 000000000000..e7ea387f4e4c --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.Serialization.cs @@ -0,0 +1,641 @@ +// 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.OracleDatabase.Models +{ + public partial class CloudExadataInfrastructureProperties : 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(CloudExadataInfrastructureProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(DefinedFileSystemConfiguration)) + { + writer.WritePropertyName("definedFileSystemConfiguration"u8); + writer.WriteStartArray(); + foreach (var item in DefinedFileSystemConfiguration) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Ocid)) + { + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + } + if (Optional.IsDefined(ComputeCount)) + { + writer.WritePropertyName("computeCount"u8); + writer.WriteNumberValue(ComputeCount.Value); + } + if (Optional.IsDefined(StorageCount)) + { + writer.WritePropertyName("storageCount"u8); + writer.WriteNumberValue(StorageCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(TotalStorageSizeInGbs)) + { + writer.WritePropertyName("totalStorageSizeInGbs"u8); + writer.WriteNumberValue(TotalStorageSizeInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(AvailableStorageSizeInGbs)) + { + writer.WritePropertyName("availableStorageSizeInGbs"u8); + writer.WriteNumberValue(AvailableStorageSizeInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(TimeCreated)) + { + writer.WritePropertyName("timeCreated"u8); + writer.WriteStringValue(TimeCreated); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleDetails)) + { + writer.WritePropertyName("lifecycleDetails"u8); + writer.WriteStringValue(LifecycleDetails); + } + if (Optional.IsDefined(MaintenanceWindow)) + { + writer.WritePropertyName("maintenanceWindow"u8); + writer.WriteObjectValue(MaintenanceWindow, options); + } + if (options.Format != "W" && Optional.IsDefined(EstimatedPatchingTime)) + { + writer.WritePropertyName("estimatedPatchingTime"u8); + writer.WriteObjectValue(EstimatedPatchingTime, options); + } + if (Optional.IsCollectionDefined(CustomerContacts)) + { + writer.WritePropertyName("customerContacts"u8); + writer.WriteStartArray(); + foreach (var item in CustomerContacts) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleState)) + { + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.Value.ToString()); + } + writer.WritePropertyName("shape"u8); + writer.WriteStringValue(Shape); + if (options.Format != "W" && Optional.IsDefined(OciUri)) + { + writer.WritePropertyName("ociUrl"u8); + writer.WriteStringValue(OciUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(CpuCount)) + { + writer.WritePropertyName("cpuCount"u8); + writer.WriteNumberValue(CpuCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(MaxCpuCount)) + { + writer.WritePropertyName("maxCpuCount"u8); + writer.WriteNumberValue(MaxCpuCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(MemorySizeInGbs)) + { + writer.WritePropertyName("memorySizeInGbs"u8); + writer.WriteNumberValue(MemorySizeInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(MaxMemoryInGbs)) + { + writer.WritePropertyName("maxMemoryInGbs"u8); + writer.WriteNumberValue(MaxMemoryInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(DbNodeStorageSizeInGbs)) + { + writer.WritePropertyName("dbNodeStorageSizeInGbs"u8); + writer.WriteNumberValue(DbNodeStorageSizeInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(MaxDbNodeStorageSizeInGbs)) + { + writer.WritePropertyName("maxDbNodeStorageSizeInGbs"u8); + writer.WriteNumberValue(MaxDbNodeStorageSizeInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(DataStorageSizeInTbs)) + { + writer.WritePropertyName("dataStorageSizeInTbs"u8); + writer.WriteNumberValue(DataStorageSizeInTbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(MaxDataStorageInTbs)) + { + writer.WritePropertyName("maxDataStorageInTbs"u8); + writer.WriteNumberValue(MaxDataStorageInTbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(DbServerVersion)) + { + writer.WritePropertyName("dbServerVersion"u8); + writer.WriteStringValue(DbServerVersion); + } + if (options.Format != "W" && Optional.IsDefined(StorageServerVersion)) + { + writer.WritePropertyName("storageServerVersion"u8); + writer.WriteStringValue(StorageServerVersion); + } + if (options.Format != "W" && Optional.IsDefined(ActivatedStorageCount)) + { + writer.WritePropertyName("activatedStorageCount"u8); + writer.WriteNumberValue(ActivatedStorageCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(AdditionalStorageCount)) + { + writer.WritePropertyName("additionalStorageCount"u8); + writer.WriteNumberValue(AdditionalStorageCount.Value); + } + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + if (options.Format != "W" && Optional.IsDefined(LastMaintenanceRunId)) + { + writer.WritePropertyName("lastMaintenanceRunId"u8); + writer.WriteStringValue(LastMaintenanceRunId); + } + if (options.Format != "W" && Optional.IsDefined(NextMaintenanceRunId)) + { + writer.WritePropertyName("nextMaintenanceRunId"u8); + writer.WriteStringValue(NextMaintenanceRunId); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyDbServerVersion)) + { + writer.WritePropertyName("monthlyDbServerVersion"u8); + writer.WriteStringValue(MonthlyDbServerVersion); + } + if (options.Format != "W" && Optional.IsDefined(MonthlyStorageServerVersion)) + { + writer.WritePropertyName("monthlyStorageServerVersion"u8); + writer.WriteStringValue(MonthlyStorageServerVersion); + } + if (Optional.IsDefined(DatabaseServerType)) + { + writer.WritePropertyName("databaseServerType"u8); + writer.WriteStringValue(DatabaseServerType); + } + if (Optional.IsDefined(StorageServerType)) + { + writer.WritePropertyName("storageServerType"u8); + writer.WriteStringValue(StorageServerType); + } + if (options.Format != "W" && Optional.IsDefined(ComputeModel)) + { + writer.WritePropertyName("computeModel"u8); + writer.WriteStringValue(ComputeModel.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 + } + } + } + + CloudExadataInfrastructureProperties 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(CloudExadataInfrastructureProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudExadataInfrastructureProperties(document.RootElement, options); + } + + internal static CloudExadataInfrastructureProperties DeserializeCloudExadataInfrastructureProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList definedFileSystemConfiguration = default; + string ocid = default; + int? computeCount = default; + int? storageCount = default; + int? totalStorageSizeInGbs = default; + int? availableStorageSizeInGbs = default; + string timeCreated = default; + string lifecycleDetails = default; + MaintenanceWindow maintenanceWindow = default; + EstimatedPatchingTime estimatedPatchingTime = default; + IList customerContacts = default; + AzureResourceProvisioningState? provisioningState = default; + CloudExadataInfrastructureLifecycleState? lifecycleState = default; + string shape = default; + Uri ociUrl = default; + int? cpuCount = default; + int? maxCpuCount = default; + int? memorySizeInGbs = default; + int? maxMemoryInGbs = default; + int? dbNodeStorageSizeInGbs = default; + int? maxDbNodeStorageSizeInGbs = default; + double? dataStorageSizeInTbs = default; + double? maxDataStorageInTbs = default; + string dbServerVersion = default; + string storageServerVersion = default; + int? activatedStorageCount = default; + int? additionalStorageCount = default; + string displayName = default; + string lastMaintenanceRunId = default; + string nextMaintenanceRunId = default; + string monthlyDbServerVersion = default; + string monthlyStorageServerVersion = default; + string databaseServerType = default; + string storageServerType = default; + ComputeModel? computeModel = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("definedFileSystemConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.DefinedFileSystemConfiguration.DeserializeDefinedFileSystemConfiguration(item, options)); + } + definedFileSystemConfiguration = array; + continue; + } + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("computeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("storageCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("totalStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("availableStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + timeCreated = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("maintenanceWindow"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maintenanceWindow = MaintenanceWindow.DeserializeMaintenanceWindow(property.Value, options); + continue; + } + if (property.NameEquals("estimatedPatchingTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + estimatedPatchingTime = EstimatedPatchingTime.DeserializeEstimatedPatchingTime(property.Value, options); + continue; + } + if (property.NameEquals("customerContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CustomerContact.DeserializeCustomerContact(item, options)); + } + customerContacts = array; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new CloudExadataInfrastructureLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shape"u8)) + { + shape = property.Value.GetString(); + continue; + } + if (property.NameEquals("ociUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ociUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("cpuCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxCpuCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxCpuCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("memorySizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memorySizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxMemoryInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxMemoryInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dbNodeStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbNodeStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxDbNodeStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxDbNodeStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("maxDataStorageInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxDataStorageInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("dbServerVersion"u8)) + { + dbServerVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageServerVersion"u8)) + { + storageServerVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("activatedStorageCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + activatedStorageCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("additionalStorageCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + additionalStorageCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastMaintenanceRunId"u8)) + { + lastMaintenanceRunId = property.Value.GetString(); + continue; + } + if (property.NameEquals("nextMaintenanceRunId"u8)) + { + nextMaintenanceRunId = property.Value.GetString(); + continue; + } + if (property.NameEquals("monthlyDbServerVersion"u8)) + { + monthlyDbServerVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("monthlyStorageServerVersion"u8)) + { + monthlyStorageServerVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseServerType"u8)) + { + databaseServerType = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageServerType"u8)) + { + storageServerType = property.Value.GetString(); + continue; + } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new ComputeModel(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CloudExadataInfrastructureProperties( + definedFileSystemConfiguration ?? new ChangeTrackingList(), + ocid, + computeCount, + storageCount, + totalStorageSizeInGbs, + availableStorageSizeInGbs, + timeCreated, + lifecycleDetails, + maintenanceWindow, + estimatedPatchingTime, + customerContacts ?? new ChangeTrackingList(), + provisioningState, + lifecycleState, + shape, + ociUrl, + cpuCount, + maxCpuCount, + memorySizeInGbs, + maxMemoryInGbs, + dbNodeStorageSizeInGbs, + maxDbNodeStorageSizeInGbs, + dataStorageSizeInTbs, + maxDataStorageInTbs, + dbServerVersion, + storageServerVersion, + activatedStorageCount, + additionalStorageCount, + displayName, + lastMaintenanceRunId, + nextMaintenanceRunId, + monthlyDbServerVersion, + monthlyStorageServerVersion, + databaseServerType, + storageServerType, + computeModel, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CloudExadataInfrastructureProperties)} does not support writing '{options.Format}' format."); + } + } + + CloudExadataInfrastructureProperties 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 DeserializeCloudExadataInfrastructureProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CloudExadataInfrastructureProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.cs new file mode 100644 index 000000000000..6f7af4dd76ea --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureProperties.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// CloudExadataInfrastructure resource model. + public partial class CloudExadataInfrastructureProperties + { + /// + /// 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 model name of the cloud Exadata infrastructure resource. + /// The name for the Exadata infrastructure. + /// or is null. + public CloudExadataInfrastructureProperties(string shape, string displayName) + { + Argument.AssertNotNull(shape, nameof(shape)); + Argument.AssertNotNull(displayName, nameof(displayName)); + + DefinedFileSystemConfiguration = new ChangeTrackingList(); + CustomerContacts = new ChangeTrackingList(); + Shape = shape; + DisplayName = displayName; + } + + /// Initializes a new instance of . + /// Defined file system configurations. + /// Exadata infra ocid. + /// The number of compute servers for the cloud Exadata infrastructure. + /// The number of storage servers for the cloud Exadata infrastructure. + /// The total storage allocated to the cloud Exadata infrastructure resource, in gigabytes (GB). + /// The available storage can be allocated to the cloud Exadata infrastructure resource, in gigabytes (GB). + /// The date and time the cloud Exadata infrastructure resource was created. + /// Additional information about the current lifecycle state. + /// maintenanceWindow property. + /// The estimated total time required in minutes for all patching operations (database server, storage server, and network switch patching). + /// The list of customer email addresses that receive information from Oracle about the specified OCI Database service resource. Oracle uses these email addresses to send notifications about planned and unplanned software maintenance updates, information about system hardware, and other information needed by administrators. Up to 10 email addresses can be added to the customer contacts for a cloud Exadata infrastructure instance. + /// CloudExadataInfrastructure provisioning state. + /// CloudExadataInfrastructure lifecycle state. + /// The model name of the cloud Exadata infrastructure resource. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// The total number of CPU cores allocated. + /// The total number of CPU cores available. + /// The memory allocated in GBs. + /// The total memory available in GBs. + /// The local node storage to be allocated in GBs. + /// The total local node storage available in GBs. + /// The quantity of data in the database, in terabytes. + /// The total available DATA disk group size. + /// The software version of the database servers (dom0) in the Exadata infrastructure. + /// The software version of the storage servers (cells) in the Exadata infrastructure. + /// The requested number of additional storage servers activated for the Exadata infrastructure. + /// The requested number of additional storage servers for the Exadata infrastructure. + /// The name for the Exadata infrastructure. + /// The OCID of the last maintenance run. + /// The OCID of the next maintenance run. + /// Monthly Db Server version. + /// Monthly Storage Server version. + /// The database server model type of the cloud Exadata infrastructure resource. + /// The storage server model type of the cloud Exadata infrastructure resource. + /// The compute model of the Exadata Infrastructure. + /// Keeps track of any properties unknown to the library. + internal CloudExadataInfrastructureProperties(IReadOnlyList definedFileSystemConfiguration, string ocid, int? computeCount, int? storageCount, int? totalStorageSizeInGbs, int? availableStorageSizeInGbs, string timeCreated, string lifecycleDetails, MaintenanceWindow maintenanceWindow, EstimatedPatchingTime estimatedPatchingTime, IList customerContacts, AzureResourceProvisioningState? provisioningState, CloudExadataInfrastructureLifecycleState? lifecycleState, string shape, Uri ociUri, int? cpuCount, int? maxCpuCount, int? memorySizeInGbs, int? maxMemoryInGbs, int? dbNodeStorageSizeInGbs, int? maxDbNodeStorageSizeInGbs, double? dataStorageSizeInTbs, double? maxDataStorageInTbs, string dbServerVersion, string storageServerVersion, int? activatedStorageCount, int? additionalStorageCount, string displayName, string lastMaintenanceRunId, string nextMaintenanceRunId, string monthlyDbServerVersion, string monthlyStorageServerVersion, string databaseServerType, string storageServerType, ComputeModel? computeModel, IDictionary serializedAdditionalRawData) + { + DefinedFileSystemConfiguration = definedFileSystemConfiguration; + Ocid = ocid; + ComputeCount = computeCount; + StorageCount = storageCount; + TotalStorageSizeInGbs = totalStorageSizeInGbs; + AvailableStorageSizeInGbs = availableStorageSizeInGbs; + TimeCreated = timeCreated; + LifecycleDetails = lifecycleDetails; + MaintenanceWindow = maintenanceWindow; + EstimatedPatchingTime = estimatedPatchingTime; + CustomerContacts = customerContacts; + ProvisioningState = provisioningState; + LifecycleState = lifecycleState; + Shape = shape; + OciUri = ociUri; + CpuCount = cpuCount; + MaxCpuCount = maxCpuCount; + MemorySizeInGbs = memorySizeInGbs; + MaxMemoryInGbs = maxMemoryInGbs; + DbNodeStorageSizeInGbs = dbNodeStorageSizeInGbs; + MaxDbNodeStorageSizeInGbs = maxDbNodeStorageSizeInGbs; + DataStorageSizeInTbs = dataStorageSizeInTbs; + MaxDataStorageInTbs = maxDataStorageInTbs; + DbServerVersion = dbServerVersion; + StorageServerVersion = storageServerVersion; + ActivatedStorageCount = activatedStorageCount; + AdditionalStorageCount = additionalStorageCount; + DisplayName = displayName; + LastMaintenanceRunId = lastMaintenanceRunId; + NextMaintenanceRunId = nextMaintenanceRunId; + MonthlyDbServerVersion = monthlyDbServerVersion; + MonthlyStorageServerVersion = monthlyStorageServerVersion; + DatabaseServerType = databaseServerType; + StorageServerType = storageServerType; + ComputeModel = computeModel; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CloudExadataInfrastructureProperties() + { + } + + /// Defined file system configurations. + public IReadOnlyList DefinedFileSystemConfiguration { get; } + /// Exadata infra ocid. + public string Ocid { get; } + /// The number of compute servers for the cloud Exadata infrastructure. + public int? ComputeCount { get; set; } + /// The number of storage servers for the cloud Exadata infrastructure. + public int? StorageCount { get; set; } + /// The total storage allocated to the cloud Exadata infrastructure resource, in gigabytes (GB). + public int? TotalStorageSizeInGbs { get; } + /// The available storage can be allocated to the cloud Exadata infrastructure resource, in gigabytes (GB). + public int? AvailableStorageSizeInGbs { get; } + /// The date and time the cloud Exadata infrastructure resource was created. + public string TimeCreated { get; } + /// Additional information about the current lifecycle state. + public string LifecycleDetails { get; } + /// maintenanceWindow property. + public MaintenanceWindow MaintenanceWindow { get; set; } + /// The estimated total time required in minutes for all patching operations (database server, storage server, and network switch patching). + public EstimatedPatchingTime EstimatedPatchingTime { get; } + /// The list of customer email addresses that receive information from Oracle about the specified OCI Database service resource. Oracle uses these email addresses to send notifications about planned and unplanned software maintenance updates, information about system hardware, and other information needed by administrators. Up to 10 email addresses can be added to the customer contacts for a cloud Exadata infrastructure instance. + public IList CustomerContacts { get; } + /// CloudExadataInfrastructure provisioning state. + public AzureResourceProvisioningState? ProvisioningState { get; } + /// CloudExadataInfrastructure lifecycle state. + public CloudExadataInfrastructureLifecycleState? LifecycleState { get; } + /// The model name of the cloud Exadata infrastructure resource. + public string Shape { get; set; } + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + public Uri OciUri { get; } + /// The total number of CPU cores allocated. + public int? CpuCount { get; } + /// The total number of CPU cores available. + public int? MaxCpuCount { get; } + /// The memory allocated in GBs. + public int? MemorySizeInGbs { get; } + /// The total memory available in GBs. + public int? MaxMemoryInGbs { get; } + /// The local node storage to be allocated in GBs. + public int? DbNodeStorageSizeInGbs { get; } + /// The total local node storage available in GBs. + public int? MaxDbNodeStorageSizeInGbs { get; } + /// The quantity of data in the database, in terabytes. + public double? DataStorageSizeInTbs { get; } + /// The total available DATA disk group size. + public double? MaxDataStorageInTbs { get; } + /// The software version of the database servers (dom0) in the Exadata infrastructure. + public string DbServerVersion { get; } + /// The software version of the storage servers (cells) in the Exadata infrastructure. + public string StorageServerVersion { get; } + /// The requested number of additional storage servers activated for the Exadata infrastructure. + public int? ActivatedStorageCount { get; } + /// The requested number of additional storage servers for the Exadata infrastructure. + public int? AdditionalStorageCount { get; } + /// The name for the Exadata infrastructure. + public string DisplayName { get; set; } + /// The OCID of the last maintenance run. + public string LastMaintenanceRunId { get; } + /// The OCID of the next maintenance run. + public string NextMaintenanceRunId { get; } + /// Monthly Db Server version. + public string MonthlyDbServerVersion { get; } + /// Monthly Storage Server version. + public string MonthlyStorageServerVersion { get; } + /// The database server model type of the cloud Exadata infrastructure resource. + public string DatabaseServerType { get; set; } + /// The storage server model type of the cloud Exadata infrastructure resource. + public string StorageServerType { get; set; } + /// The compute model of the Exadata Infrastructure. + public ComputeModel? ComputeModel { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureUpdateProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..967ad40ff88a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureUpdateProperties.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.OracleDatabase.Models +{ + public partial class CloudExadataInfrastructureUpdateProperties : 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(CloudExadataInfrastructureUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ComputeCount)) + { + writer.WritePropertyName("computeCount"u8); + writer.WriteNumberValue(ComputeCount.Value); + } + if (Optional.IsDefined(StorageCount)) + { + writer.WritePropertyName("storageCount"u8); + writer.WriteNumberValue(StorageCount.Value); + } + if (Optional.IsDefined(MaintenanceWindow)) + { + writer.WritePropertyName("maintenanceWindow"u8); + writer.WriteObjectValue(MaintenanceWindow, options); + } + if (Optional.IsCollectionDefined(CustomerContacts)) + { + writer.WritePropertyName("customerContacts"u8); + writer.WriteStartArray(); + foreach (var item in CustomerContacts) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + 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 + } + } + } + + CloudExadataInfrastructureUpdateProperties 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(CloudExadataInfrastructureUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudExadataInfrastructureUpdateProperties(document.RootElement, options); + } + + internal static CloudExadataInfrastructureUpdateProperties DeserializeCloudExadataInfrastructureUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? computeCount = default; + int? storageCount = default; + MaintenanceWindow maintenanceWindow = default; + IList customerContacts = default; + string displayName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("computeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("storageCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maintenanceWindow"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maintenanceWindow = MaintenanceWindow.DeserializeMaintenanceWindow(property.Value, options); + continue; + } + if (property.NameEquals("customerContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CustomerContact.DeserializeCustomerContact(item, options)); + } + customerContacts = array; + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CloudExadataInfrastructureUpdateProperties( + computeCount, + storageCount, + maintenanceWindow, + customerContacts ?? new ChangeTrackingList(), + displayName, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CloudExadataInfrastructureUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + CloudExadataInfrastructureUpdateProperties 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 DeserializeCloudExadataInfrastructureUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CloudExadataInfrastructureUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureUpdateProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureUpdateProperties.cs new file mode 100644 index 000000000000..8b009fb81db6 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudExadataInfrastructureUpdateProperties.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.OracleDatabase.Models +{ + /// The updatable properties of the CloudExadataInfrastructure. + public partial class CloudExadataInfrastructureUpdateProperties + { + /// + /// 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 CloudExadataInfrastructureUpdateProperties() + { + CustomerContacts = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The number of compute servers for the cloud Exadata infrastructure. + /// The number of storage servers for the cloud Exadata infrastructure. + /// maintenanceWindow property. + /// The list of customer email addresses that receive information from Oracle about the specified OCI Database service resource. Oracle uses these email addresses to send notifications about planned and unplanned software maintenance updates, information about system hardware, and other information needed by administrators. Up to 10 email addresses can be added to the customer contacts for a cloud Exadata infrastructure instance. + /// The name for the Exadata infrastructure. + /// Keeps track of any properties unknown to the library. + internal CloudExadataInfrastructureUpdateProperties(int? computeCount, int? storageCount, MaintenanceWindow maintenanceWindow, IList customerContacts, string displayName, IDictionary serializedAdditionalRawData) + { + ComputeCount = computeCount; + StorageCount = storageCount; + MaintenanceWindow = maintenanceWindow; + CustomerContacts = customerContacts; + DisplayName = displayName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The number of compute servers for the cloud Exadata infrastructure. + public int? ComputeCount { get; set; } + /// The number of storage servers for the cloud Exadata infrastructure. + public int? StorageCount { get; set; } + /// maintenanceWindow property. + public MaintenanceWindow MaintenanceWindow { get; set; } + /// The list of customer email addresses that receive information from Oracle about the specified OCI Database service resource. Oracle uses these email addresses to send notifications about planned and unplanned software maintenance updates, information about system hardware, and other information needed by administrators. Up to 10 email addresses can be added to the customer contacts for a cloud Exadata infrastructure instance. + public IList CustomerContacts { get; } + /// The name for the Exadata infrastructure. + public string DisplayName { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterLifecycleState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterLifecycleState.cs new file mode 100644 index 000000000000..b3d2b88efd17 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterLifecycleState.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.OracleDatabase.Models +{ + /// Cloud VM Cluster lifecycle state enum. + public readonly partial struct CloudVmClusterLifecycleState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CloudVmClusterLifecycleState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProvisioningValue = "Provisioning"; + private const string AvailableValue = "Available"; + private const string UpdatingValue = "Updating"; + private const string TerminatingValue = "Terminating"; + private const string TerminatedValue = "Terminated"; + private const string MaintenanceInProgressValue = "MaintenanceInProgress"; + private const string FailedValue = "Failed"; + + /// Indicates that resource in Provisioning state. + public static CloudVmClusterLifecycleState Provisioning { get; } = new CloudVmClusterLifecycleState(ProvisioningValue); + /// Indicates that resource in Available state. + public static CloudVmClusterLifecycleState Available { get; } = new CloudVmClusterLifecycleState(AvailableValue); + /// Indicates that resource in Updating state. + public static CloudVmClusterLifecycleState Updating { get; } = new CloudVmClusterLifecycleState(UpdatingValue); + /// Indicates that resource in Terminating state. + public static CloudVmClusterLifecycleState Terminating { get; } = new CloudVmClusterLifecycleState(TerminatingValue); + /// Indicates that resource in Terminated state. + public static CloudVmClusterLifecycleState Terminated { get; } = new CloudVmClusterLifecycleState(TerminatedValue); + /// Indicates that resource Maintenance in progress state. + public static CloudVmClusterLifecycleState MaintenanceInProgress { get; } = new CloudVmClusterLifecycleState(MaintenanceInProgressValue); + /// Indicates that resource in Failed state. + public static CloudVmClusterLifecycleState Failed { get; } = new CloudVmClusterLifecycleState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(CloudVmClusterLifecycleState left, CloudVmClusterLifecycleState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CloudVmClusterLifecycleState left, CloudVmClusterLifecycleState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CloudVmClusterLifecycleState(string value) => new CloudVmClusterLifecycleState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CloudVmClusterLifecycleState other && Equals(other); + /// + public bool Equals(CloudVmClusterLifecycleState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterListResult.Serialization.cs new file mode 100644 index 000000000000..196f84ffb5e5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterListResult.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.OracleDatabase.Models +{ + internal partial class CloudVmClusterListResult : 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(CloudVmClusterListResult)} 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 + } + } + } + + CloudVmClusterListResult 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(CloudVmClusterListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudVmClusterListResult(document.RootElement, options); + } + + internal static CloudVmClusterListResult DeserializeCloudVmClusterListResult(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(CloudVmClusterData.DeserializeCloudVmClusterData(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 CloudVmClusterListResult(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); + default: + throw new FormatException($"The model {nameof(CloudVmClusterListResult)} does not support writing '{options.Format}' format."); + } + } + + CloudVmClusterListResult 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 DeserializeCloudVmClusterListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CloudVmClusterListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterListResult.cs new file mode 100644 index 000000000000..b2c864c3ded2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterListResult.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.OracleDatabase.Models +{ + /// The response of a CloudVmCluster list operation. + internal partial class CloudVmClusterListResult + { + /// + /// 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 CloudVmCluster items on this page. + /// is null. + internal CloudVmClusterListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The CloudVmCluster items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal CloudVmClusterListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CloudVmClusterListResult() + { + } + + /// The CloudVmCluster items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterPatch.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterPatch.Serialization.cs new file mode 100644 index 000000000000..809f4363c28a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterPatch.Serialization.cs @@ -0,0 +1,159 @@ +// 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.OracleDatabase.Models +{ + public partial class CloudVmClusterPatch : 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(CloudVmClusterPatch)} does not support writing '{format}' format."); + } + + 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 (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 + } + } + } + + CloudVmClusterPatch 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(CloudVmClusterPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudVmClusterPatch(document.RootElement, options); + } + + internal static CloudVmClusterPatch DeserializeCloudVmClusterPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + CloudVmClusterUpdateProperties properties = 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 = CloudVmClusterUpdateProperties.DeserializeCloudVmClusterUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CloudVmClusterPatch(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); + default: + throw new FormatException($"The model {nameof(CloudVmClusterPatch)} does not support writing '{options.Format}' format."); + } + } + + CloudVmClusterPatch 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 DeserializeCloudVmClusterPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CloudVmClusterPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterPatch.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterPatch.cs new file mode 100644 index 000000000000..67473a1a7c53 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterPatch.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// The type used for update operations of the CloudVmCluster. + public partial class CloudVmClusterPatch + { + /// + /// 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 CloudVmClusterPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal CloudVmClusterPatch(IDictionary tags, CloudVmClusterUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + public CloudVmClusterUpdateProperties Properties { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.Serialization.cs new file mode 100644 index 000000000000..7c2dcb534b32 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.Serialization.cs @@ -0,0 +1,877 @@ +// 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.OracleDatabase.Models +{ + public partial class CloudVmClusterProperties : 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(CloudVmClusterProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Ocid)) + { + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + } + if (options.Format != "W" && Optional.IsDefined(ListenerPort)) + { + writer.WritePropertyName("listenerPort"u8); + writer.WriteNumberValue(ListenerPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(NodeCount)) + { + writer.WritePropertyName("nodeCount"u8); + writer.WriteNumberValue(NodeCount.Value); + } + if (Optional.IsDefined(StorageSizeInGbs)) + { + writer.WritePropertyName("storageSizeInGbs"u8); + writer.WriteNumberValue(StorageSizeInGbs.Value); + } + if (Optional.IsCollectionDefined(FileSystemConfigurationDetails)) + { + writer.WritePropertyName("fileSystemConfigurationDetails"u8); + writer.WriteStartArray(); + foreach (var item in FileSystemConfigurationDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DataStorageSizeInTbs)) + { + writer.WritePropertyName("dataStorageSizeInTbs"u8); + writer.WriteNumberValue(DataStorageSizeInTbs.Value); + } + if (Optional.IsDefined(DbNodeStorageSizeInGbs)) + { + writer.WritePropertyName("dbNodeStorageSizeInGbs"u8); + writer.WriteNumberValue(DbNodeStorageSizeInGbs.Value); + } + if (Optional.IsDefined(MemorySizeInGbs)) + { + writer.WritePropertyName("memorySizeInGbs"u8); + writer.WriteNumberValue(MemorySizeInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(TimeCreated)) + { + writer.WritePropertyName("timeCreated"u8); + writer.WriteStringValue(TimeCreated.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleDetails)) + { + writer.WritePropertyName("lifecycleDetails"u8); + writer.WriteStringValue(LifecycleDetails); + } + if (Optional.IsDefined(TimeZone)) + { + writer.WritePropertyName("timeZone"u8); + writer.WriteStringValue(TimeZone); + } + if (Optional.IsDefined(ZoneId)) + { + writer.WritePropertyName("zoneId"u8); + writer.WriteStringValue(ZoneId); + } + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + if (Optional.IsDefined(Domain)) + { + writer.WritePropertyName("domain"u8); + writer.WriteStringValue(Domain); + } + writer.WritePropertyName("cpuCoreCount"u8); + writer.WriteNumberValue(CpuCoreCount); + if (Optional.IsDefined(OcpuCount)) + { + writer.WritePropertyName("ocpuCount"u8); + writer.WriteNumberValue(OcpuCount.Value); + } + if (Optional.IsDefined(ClusterName)) + { + writer.WritePropertyName("clusterName"u8); + writer.WriteStringValue(ClusterName); + } + if (Optional.IsDefined(DataStoragePercentage)) + { + writer.WritePropertyName("dataStoragePercentage"u8); + writer.WriteNumberValue(DataStoragePercentage.Value); + } + if (Optional.IsDefined(IsLocalBackupEnabled)) + { + writer.WritePropertyName("isLocalBackupEnabled"u8); + writer.WriteBooleanValue(IsLocalBackupEnabled.Value); + } + writer.WritePropertyName("cloudExadataInfrastructureId"u8); + writer.WriteStringValue(CloudExadataInfrastructureId); + if (Optional.IsDefined(IsSparseDiskgroupEnabled)) + { + writer.WritePropertyName("isSparseDiskgroupEnabled"u8); + writer.WriteBooleanValue(IsSparseDiskgroupEnabled.Value); + } + if (Optional.IsDefined(SystemVersion)) + { + writer.WritePropertyName("systemVersion"u8); + writer.WriteStringValue(SystemVersion); + } + writer.WritePropertyName("sshPublicKeys"u8); + writer.WriteStartArray(); + foreach (var item in SshPublicKeys) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(LicenseModel)) + { + writer.WritePropertyName("licenseModel"u8); + writer.WriteStringValue(LicenseModel.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(DiskRedundancy)) + { + writer.WritePropertyName("diskRedundancy"u8); + writer.WriteStringValue(DiskRedundancy.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ScanIPIds)) + { + writer.WritePropertyName("scanIpIds"u8); + writer.WriteStartArray(); + foreach (var item in ScanIPIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(VipIds)) + { + writer.WritePropertyName("vipIds"u8); + writer.WriteStartArray(); + foreach (var item in VipIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ScanDnsName)) + { + writer.WritePropertyName("scanDnsName"u8); + writer.WriteStringValue(ScanDnsName); + } + if (Optional.IsDefined(ScanListenerPortTcp)) + { + writer.WritePropertyName("scanListenerPortTcp"u8); + writer.WriteNumberValue(ScanListenerPortTcp.Value); + } + if (Optional.IsDefined(ScanListenerPortTcpSsl)) + { + writer.WritePropertyName("scanListenerPortTcpSsl"u8); + writer.WriteNumberValue(ScanListenerPortTcpSsl.Value); + } + if (options.Format != "W" && Optional.IsDefined(ScanDnsRecordId)) + { + writer.WritePropertyName("scanDnsRecordId"u8); + writer.WriteStringValue(ScanDnsRecordId); + } + if (options.Format != "W" && Optional.IsDefined(Shape)) + { + writer.WritePropertyName("shape"u8); + writer.WriteStringValue(Shape); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleState)) + { + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.Value.ToString()); + } + writer.WritePropertyName("vnetId"u8); + writer.WriteStringValue(VnetId); + writer.WritePropertyName("giVersion"u8); + writer.WriteStringValue(GiVersion); + if (options.Format != "W" && Optional.IsDefined(OciUri)) + { + writer.WritePropertyName("ociUrl"u8); + writer.WriteStringValue(OciUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(NsgUri)) + { + writer.WritePropertyName("nsgUrl"u8); + writer.WriteStringValue(NsgUri.AbsoluteUri); + } + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + if (Optional.IsDefined(BackupSubnetCidr)) + { + writer.WritePropertyName("backupSubnetCidr"u8); + writer.WriteStringValue(BackupSubnetCidr); + } + if (Optional.IsCollectionDefined(NsgCidrs)) + { + writer.WritePropertyName("nsgCidrs"u8); + writer.WriteStartArray(); + foreach (var item in NsgCidrs) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DataCollectionOptions)) + { + writer.WritePropertyName("dataCollectionOptions"u8); + writer.WriteObjectValue(DataCollectionOptions, options); + } + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + if (Optional.IsCollectionDefined(ComputeNodes)) + { + writer.WritePropertyName("computeNodes"u8); + writer.WriteStartArray(); + foreach (var item in ComputeNodes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(IormConfigCache)) + { + writer.WritePropertyName("iormConfigCache"u8); + writer.WriteObjectValue(IormConfigCache, options); + } + if (options.Format != "W" && Optional.IsDefined(LastUpdateHistoryEntryId)) + { + writer.WritePropertyName("lastUpdateHistoryEntryId"u8); + writer.WriteStringValue(LastUpdateHistoryEntryId); + } + if (Optional.IsCollectionDefined(DbServers)) + { + writer.WritePropertyName("dbServers"u8); + writer.WriteStartArray(); + foreach (var item in DbServers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(CompartmentId)) + { + writer.WritePropertyName("compartmentId"u8); + writer.WriteStringValue(CompartmentId); + } + if (options.Format != "W" && Optional.IsDefined(SubnetOcid)) + { + writer.WritePropertyName("subnetOcid"u8); + writer.WriteStringValue(SubnetOcid); + } + if (options.Format != "W" && Optional.IsDefined(ComputeModel)) + { + writer.WritePropertyName("computeModel"u8); + writer.WriteStringValue(ComputeModel.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 + } + } + } + + CloudVmClusterProperties 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(CloudVmClusterProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudVmClusterProperties(document.RootElement, options); + } + + internal static CloudVmClusterProperties DeserializeCloudVmClusterProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string ocid = default; + long? listenerPort = default; + int? nodeCount = default; + int? storageSizeInGbs = default; + IList fileSystemConfigurationDetails = default; + double? dataStorageSizeInTbs = default; + int? dbNodeStorageSizeInGbs = default; + int? memorySizeInGbs = default; + DateTimeOffset? timeCreated = default; + string lifecycleDetails = default; + string timeZone = default; + string zoneId = default; + string hostname = default; + string domain = default; + int cpuCoreCount = default; + float? ocpuCount = default; + string clusterName = default; + int? dataStoragePercentage = default; + bool? isLocalBackupEnabled = default; + ResourceIdentifier cloudExadataInfrastructureId = default; + bool? isSparseDiskgroupEnabled = default; + string systemVersion = default; + IList sshPublicKeys = default; + LicenseModel? licenseModel = default; + DiskRedundancy? diskRedundancy = default; + IReadOnlyList scanIPIds = default; + IReadOnlyList vipIds = default; + string scanDnsName = default; + int? scanListenerPortTcp = default; + int? scanListenerPortTcpSsl = default; + string scanDnsRecordId = default; + string shape = default; + AzureResourceProvisioningState? provisioningState = default; + CloudVmClusterLifecycleState? lifecycleState = default; + ResourceIdentifier vnetId = default; + string giVersion = default; + Uri ociUrl = default; + Uri nsgUrl = default; + ResourceIdentifier subnetId = default; + string backupSubnetCidr = default; + IList nsgCidrs = default; + DataCollectionOptions dataCollectionOptions = default; + string displayName = default; + IList computeNodes = default; + ExadataIormConfig iormConfigCache = default; + string lastUpdateHistoryEntryId = default; + IList dbServers = default; + string compartmentId = default; + string subnetOcid = default; + ComputeModel? computeModel = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("listenerPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + listenerPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("nodeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("storageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("fileSystemConfigurationDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.FileSystemConfigurationDetails.DeserializeFileSystemConfigurationDetails(item, options)); + } + fileSystemConfigurationDetails = array; + continue; + } + if (property.NameEquals("dataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("dbNodeStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbNodeStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("memorySizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memorySizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeZone"u8)) + { + timeZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("zoneId"u8)) + { + zoneId = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("domain"u8)) + { + domain = property.Value.GetString(); + continue; + } + if (property.NameEquals("cpuCoreCount"u8)) + { + cpuCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("ocpuCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ocpuCount = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("clusterName"u8)) + { + clusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataStoragePercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStoragePercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isLocalBackupEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isLocalBackupEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("cloudExadataInfrastructureId"u8)) + { + cloudExadataInfrastructureId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSparseDiskgroupEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSparseDiskgroupEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("systemVersion"u8)) + { + systemVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("sshPublicKeys"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sshPublicKeys = array; + continue; + } + if (property.NameEquals("licenseModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + licenseModel = new LicenseModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("diskRedundancy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskRedundancy = new DiskRedundancy(property.Value.GetString()); + continue; + } + if (property.NameEquals("scanIpIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + scanIPIds = array; + continue; + } + if (property.NameEquals("vipIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + vipIds = array; + continue; + } + if (property.NameEquals("scanDnsName"u8)) + { + scanDnsName = property.Value.GetString(); + continue; + } + if (property.NameEquals("scanListenerPortTcp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scanListenerPortTcp = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("scanListenerPortTcpSsl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scanListenerPortTcpSsl = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("scanDnsRecordId"u8)) + { + scanDnsRecordId = property.Value.GetString(); + continue; + } + if (property.NameEquals("shape"u8)) + { + shape = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new CloudVmClusterLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("vnetId"u8)) + { + vnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("giVersion"u8)) + { + giVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("ociUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ociUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("nsgUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nsgUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("backupSubnetCidr"u8)) + { + backupSubnetCidr = property.Value.GetString(); + continue; + } + if (property.NameEquals("nsgCidrs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NsgCidr.DeserializeNsgCidr(item, options)); + } + nsgCidrs = array; + continue; + } + if (property.NameEquals("dataCollectionOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataCollectionOptions = DataCollectionOptions.DeserializeDataCollectionOptions(property.Value, options); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("computeNodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + computeNodes = array; + continue; + } + if (property.NameEquals("iormConfigCache"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iormConfigCache = ExadataIormConfig.DeserializeExadataIormConfig(property.Value, options); + continue; + } + if (property.NameEquals("lastUpdateHistoryEntryId"u8)) + { + lastUpdateHistoryEntryId = property.Value.GetString(); + continue; + } + if (property.NameEquals("dbServers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dbServers = array; + continue; + } + if (property.NameEquals("compartmentId"u8)) + { + compartmentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnetOcid"u8)) + { + subnetOcid = property.Value.GetString(); + continue; + } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new ComputeModel(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CloudVmClusterProperties( + ocid, + listenerPort, + nodeCount, + storageSizeInGbs, + fileSystemConfigurationDetails ?? new ChangeTrackingList(), + dataStorageSizeInTbs, + dbNodeStorageSizeInGbs, + memorySizeInGbs, + timeCreated, + lifecycleDetails, + timeZone, + zoneId, + hostname, + domain, + cpuCoreCount, + ocpuCount, + clusterName, + dataStoragePercentage, + isLocalBackupEnabled, + cloudExadataInfrastructureId, + isSparseDiskgroupEnabled, + systemVersion, + sshPublicKeys, + licenseModel, + diskRedundancy, + scanIPIds ?? new ChangeTrackingList(), + vipIds ?? new ChangeTrackingList(), + scanDnsName, + scanListenerPortTcp, + scanListenerPortTcpSsl, + scanDnsRecordId, + shape, + provisioningState, + lifecycleState, + vnetId, + giVersion, + ociUrl, + nsgUrl, + subnetId, + backupSubnetCidr, + nsgCidrs ?? new ChangeTrackingList(), + dataCollectionOptions, + displayName, + computeNodes ?? new ChangeTrackingList(), + iormConfigCache, + lastUpdateHistoryEntryId, + dbServers ?? new ChangeTrackingList(), + compartmentId, + subnetOcid, + computeModel, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CloudVmClusterProperties)} does not support writing '{options.Format}' format."); + } + } + + CloudVmClusterProperties 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 DeserializeCloudVmClusterProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CloudVmClusterProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.cs new file mode 100644 index 000000000000..d60ca6595848 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterProperties.cs @@ -0,0 +1,299 @@ +// 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.OracleDatabase.Models +{ + /// CloudVmCluster resource model. + public partial class CloudVmClusterProperties + { + /// + /// 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 hostname for the cloud VM cluster. + /// The number of CPU cores enabled on the cloud VM cluster. + /// Cloud Exadata Infrastructure ID. + /// The public key portion of one or more key pairs used for SSH access to the cloud VM cluster. + /// VNET for network connectivity. + /// Oracle Grid Infrastructure (GI) software version. + /// Client subnet. + /// Display Name. + /// , , , , , or is null. + public CloudVmClusterProperties(string hostname, int cpuCoreCount, ResourceIdentifier cloudExadataInfrastructureId, IEnumerable sshPublicKeys, ResourceIdentifier vnetId, string giVersion, ResourceIdentifier subnetId, string displayName) + { + Argument.AssertNotNull(hostname, nameof(hostname)); + Argument.AssertNotNull(cloudExadataInfrastructureId, nameof(cloudExadataInfrastructureId)); + Argument.AssertNotNull(sshPublicKeys, nameof(sshPublicKeys)); + Argument.AssertNotNull(vnetId, nameof(vnetId)); + Argument.AssertNotNull(giVersion, nameof(giVersion)); + Argument.AssertNotNull(subnetId, nameof(subnetId)); + Argument.AssertNotNull(displayName, nameof(displayName)); + + FileSystemConfigurationDetails = new ChangeTrackingList(); + Hostname = hostname; + CpuCoreCount = cpuCoreCount; + CloudExadataInfrastructureId = cloudExadataInfrastructureId; + SshPublicKeys = sshPublicKeys.ToList(); + ScanIPIds = new ChangeTrackingList(); + VipIds = new ChangeTrackingList(); + VnetId = vnetId; + GiVersion = giVersion; + SubnetId = subnetId; + NsgCidrs = new ChangeTrackingList(); + DisplayName = displayName; + ComputeNodes = new ChangeTrackingList(); + DbServers = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Cloud VM Cluster ocid. + /// The port number configured for the listener on the cloud VM cluster. + /// The number of nodes in the cloud VM cluster. + /// The data disk group size to be allocated in GBs per VM. + /// Array of mount path and size. + /// The data disk group size to be allocated in TBs. + /// The local node storage to be allocated in GBs. + /// The memory to be allocated in GBs. + /// The date and time that the cloud VM cluster was created. + /// Additional information about the current lifecycle state. + /// The time zone of the cloud VM cluster. For details, see [Exadata Infrastructure Time Zones](/Content/Database/References/timezones.htm). + /// The OCID of the zone the cloud VM cluster is associated with. + /// The hostname for the cloud VM cluster. + /// The domain name for the cloud VM cluster. + /// The number of CPU cores enabled on the cloud VM cluster. + /// The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal place is allowed for the fractional part. + /// The cluster name for cloud VM cluster. The cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + /// The percentage assigned to DATA storage (user data and database files). The remaining percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager backups). Accepted values are 35, 40, 60 and 80. The default is 80 percent assigned to DATA storage. See [Storage Configuration](/Content/Database/Concepts/exaoverview.htm#Exadata) in the Exadata documentation for details on the impact of the configuration settings on storage. + /// If true, database backup on local Exadata storage is configured for the cloud VM cluster. If false, database backup on local Exadata storage is not available in the cloud VM cluster. + /// Cloud Exadata Infrastructure ID. + /// If true, sparse disk group is configured for the cloud VM cluster. If false, sparse disk group is not created. + /// Operating system version of the image. + /// The public key portion of one or more key pairs used for SSH access to the cloud VM cluster. + /// The Oracle license model that applies to the cloud VM cluster. The default is LICENSE_INCLUDED. + /// The type of redundancy configured for the cloud Vm cluster. NORMAL is 2-way redundancy. HIGH is 3-way redundancy. + /// The Single Client Access Name (SCAN) IP addresses associated with the cloud VM cluster. SCAN IP addresses are typically used for load balancing and are not assigned to any interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. **Note:** For a single-node DB system, this list is empty. + /// The virtual IP (VIP) addresses associated with the cloud VM cluster. The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata Cloud Service instance to enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. **Note:** For a single-node DB system, this list is empty. + /// The FQDN of the DNS record for the SCAN IP addresses that are associated with the cloud VM cluster. + /// The TCP Single Client Access Name (SCAN) port. The default port is 1521. + /// The TCPS Single Client Access Name (SCAN) port. The default port is 2484. + /// The OCID of the DNS record for the SCAN IP addresses that are associated with the cloud VM cluster. + /// The model name of the Exadata hardware running the cloud VM cluster. + /// CloudVmCluster provisioning state. + /// CloudVmCluster lifecycle state. + /// VNET for network connectivity. + /// Oracle Grid Infrastructure (GI) software version. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface. + /// Client subnet. + /// Client OCI backup subnet CIDR, default is 192.168.252.0/22. + /// CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster will be added by default. + /// Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + /// Display Name. + /// The list of compute servers to be added to the cloud VM cluster. + /// iormConfigCache details for cloud VM cluster. + /// The OCID of the last maintenance update history entry. + /// The list of DB servers. + /// Cluster compartmentId. + /// Cluster subnet ocid. + /// The compute model of the VM Cluster. + /// Keeps track of any properties unknown to the library. + internal CloudVmClusterProperties(string ocid, long? listenerPort, int? nodeCount, int? storageSizeInGbs, IList fileSystemConfigurationDetails, double? dataStorageSizeInTbs, int? dbNodeStorageSizeInGbs, int? memorySizeInGbs, DateTimeOffset? timeCreated, string lifecycleDetails, string timeZone, string zoneId, string hostname, string domain, int cpuCoreCount, float? ocpuCount, string clusterName, int? dataStoragePercentage, bool? isLocalBackupEnabled, ResourceIdentifier cloudExadataInfrastructureId, bool? isSparseDiskgroupEnabled, string systemVersion, IList sshPublicKeys, LicenseModel? licenseModel, DiskRedundancy? diskRedundancy, IReadOnlyList scanIPIds, IReadOnlyList vipIds, string scanDnsName, int? scanListenerPortTcp, int? scanListenerPortTcpSsl, string scanDnsRecordId, string shape, AzureResourceProvisioningState? provisioningState, CloudVmClusterLifecycleState? lifecycleState, ResourceIdentifier vnetId, string giVersion, Uri ociUri, Uri nsgUri, ResourceIdentifier subnetId, string backupSubnetCidr, IList nsgCidrs, DataCollectionOptions dataCollectionOptions, string displayName, IList computeNodes, ExadataIormConfig iormConfigCache, string lastUpdateHistoryEntryId, IList dbServers, string compartmentId, string subnetOcid, ComputeModel? computeModel, IDictionary serializedAdditionalRawData) + { + Ocid = ocid; + ListenerPort = listenerPort; + NodeCount = nodeCount; + StorageSizeInGbs = storageSizeInGbs; + FileSystemConfigurationDetails = fileSystemConfigurationDetails; + DataStorageSizeInTbs = dataStorageSizeInTbs; + DbNodeStorageSizeInGbs = dbNodeStorageSizeInGbs; + MemorySizeInGbs = memorySizeInGbs; + TimeCreated = timeCreated; + LifecycleDetails = lifecycleDetails; + TimeZone = timeZone; + ZoneId = zoneId; + Hostname = hostname; + Domain = domain; + CpuCoreCount = cpuCoreCount; + OcpuCount = ocpuCount; + ClusterName = clusterName; + DataStoragePercentage = dataStoragePercentage; + IsLocalBackupEnabled = isLocalBackupEnabled; + CloudExadataInfrastructureId = cloudExadataInfrastructureId; + IsSparseDiskgroupEnabled = isSparseDiskgroupEnabled; + SystemVersion = systemVersion; + SshPublicKeys = sshPublicKeys; + LicenseModel = licenseModel; + DiskRedundancy = diskRedundancy; + ScanIPIds = scanIPIds; + VipIds = vipIds; + ScanDnsName = scanDnsName; + ScanListenerPortTcp = scanListenerPortTcp; + ScanListenerPortTcpSsl = scanListenerPortTcpSsl; + ScanDnsRecordId = scanDnsRecordId; + Shape = shape; + ProvisioningState = provisioningState; + LifecycleState = lifecycleState; + VnetId = vnetId; + GiVersion = giVersion; + OciUri = ociUri; + NsgUri = nsgUri; + SubnetId = subnetId; + BackupSubnetCidr = backupSubnetCidr; + NsgCidrs = nsgCidrs; + DataCollectionOptions = dataCollectionOptions; + DisplayName = displayName; + ComputeNodes = computeNodes; + IormConfigCache = iormConfigCache; + LastUpdateHistoryEntryId = lastUpdateHistoryEntryId; + DbServers = dbServers; + CompartmentId = compartmentId; + SubnetOcid = subnetOcid; + ComputeModel = computeModel; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CloudVmClusterProperties() + { + } + + /// Cloud VM Cluster ocid. + public string Ocid { get; } + /// The port number configured for the listener on the cloud VM cluster. + public long? ListenerPort { get; } + /// The number of nodes in the cloud VM cluster. + public int? NodeCount { get; } + /// The data disk group size to be allocated in GBs per VM. + public int? StorageSizeInGbs { get; set; } + /// Array of mount path and size. + public IList FileSystemConfigurationDetails { get; } + /// The data disk group size to be allocated in TBs. + public double? DataStorageSizeInTbs { get; set; } + /// The local node storage to be allocated in GBs. + public int? DbNodeStorageSizeInGbs { get; set; } + /// The memory to be allocated in GBs. + public int? MemorySizeInGbs { get; set; } + /// The date and time that the cloud VM cluster was created. + public DateTimeOffset? TimeCreated { get; } + /// Additional information about the current lifecycle state. + public string LifecycleDetails { get; } + /// The time zone of the cloud VM cluster. For details, see [Exadata Infrastructure Time Zones](/Content/Database/References/timezones.htm). + public string TimeZone { get; set; } + /// The OCID of the zone the cloud VM cluster is associated with. + public string ZoneId { get; set; } + /// The hostname for the cloud VM cluster. + public string Hostname { get; set; } + /// The domain name for the cloud VM cluster. + public string Domain { get; set; } + /// The number of CPU cores enabled on the cloud VM cluster. + public int CpuCoreCount { get; set; } + /// The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal place is allowed for the fractional part. + public float? OcpuCount { get; set; } + /// The cluster name for cloud VM cluster. The cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + public string ClusterName { get; set; } + /// The percentage assigned to DATA storage (user data and database files). The remaining percentage is assigned to RECO storage (database redo logs, archive logs, and recovery manager backups). Accepted values are 35, 40, 60 and 80. The default is 80 percent assigned to DATA storage. See [Storage Configuration](/Content/Database/Concepts/exaoverview.htm#Exadata) in the Exadata documentation for details on the impact of the configuration settings on storage. + public int? DataStoragePercentage { get; set; } + /// If true, database backup on local Exadata storage is configured for the cloud VM cluster. If false, database backup on local Exadata storage is not available in the cloud VM cluster. + public bool? IsLocalBackupEnabled { get; set; } + /// Cloud Exadata Infrastructure ID. + public ResourceIdentifier CloudExadataInfrastructureId { get; set; } + /// If true, sparse disk group is configured for the cloud VM cluster. If false, sparse disk group is not created. + public bool? IsSparseDiskgroupEnabled { get; set; } + /// Operating system version of the image. + public string SystemVersion { get; set; } + /// The public key portion of one or more key pairs used for SSH access to the cloud VM cluster. + public IList SshPublicKeys { get; } + /// The Oracle license model that applies to the cloud VM cluster. The default is LICENSE_INCLUDED. + public LicenseModel? LicenseModel { get; set; } + /// The type of redundancy configured for the cloud Vm cluster. NORMAL is 2-way redundancy. HIGH is 3-way redundancy. + public DiskRedundancy? DiskRedundancy { get; } + /// The Single Client Access Name (SCAN) IP addresses associated with the cloud VM cluster. SCAN IP addresses are typically used for load balancing and are not assigned to any interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. **Note:** For a single-node DB system, this list is empty. + public IReadOnlyList ScanIPIds { get; } + /// The virtual IP (VIP) addresses associated with the cloud VM cluster. The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata Cloud Service instance to enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. **Note:** For a single-node DB system, this list is empty. + public IReadOnlyList VipIds { get; } + /// The FQDN of the DNS record for the SCAN IP addresses that are associated with the cloud VM cluster. + public string ScanDnsName { get; } + /// The TCP Single Client Access Name (SCAN) port. The default port is 1521. + public int? ScanListenerPortTcp { get; set; } + /// The TCPS Single Client Access Name (SCAN) port. The default port is 2484. + public int? ScanListenerPortTcpSsl { get; set; } + /// The OCID of the DNS record for the SCAN IP addresses that are associated with the cloud VM cluster. + public string ScanDnsRecordId { get; } + /// The model name of the Exadata hardware running the cloud VM cluster. + public string Shape { get; } + /// CloudVmCluster provisioning state. + public AzureResourceProvisioningState? ProvisioningState { get; } + /// CloudVmCluster lifecycle state. + public CloudVmClusterLifecycleState? LifecycleState { get; } + /// VNET for network connectivity. + public ResourceIdentifier VnetId { get; set; } + /// Oracle Grid Infrastructure (GI) software version. + public string GiVersion { get; set; } + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + public Uri OciUri { get; } + /// HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface. + public Uri NsgUri { get; } + /// Client subnet. + public ResourceIdentifier SubnetId { get; set; } + /// Client OCI backup subnet CIDR, default is 192.168.252.0/22. + public string BackupSubnetCidr { get; set; } + /// CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster will be added by default. + public IList NsgCidrs { get; } + /// Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + public DataCollectionOptions DataCollectionOptions { get; set; } + /// Display Name. + public string DisplayName { get; set; } + /// The list of compute servers to be added to the cloud VM cluster. + public IList ComputeNodes { get; } + /// iormConfigCache details for cloud VM cluster. + public ExadataIormConfig IormConfigCache { get; } + /// The OCID of the last maintenance update history entry. + public string LastUpdateHistoryEntryId { get; } + /// The list of DB servers. + public IList DbServers { get; } + /// Cluster compartmentId. + public string CompartmentId { get; } + /// Cluster subnet ocid. + public string SubnetOcid { get; } + /// The compute model of the VM Cluster. + public ComputeModel? ComputeModel { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..c0b836b1d1d8 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.Serialization.cs @@ -0,0 +1,337 @@ +// 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.OracleDatabase.Models +{ + public partial class CloudVmClusterUpdateProperties : 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(CloudVmClusterUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(StorageSizeInGbs)) + { + writer.WritePropertyName("storageSizeInGbs"u8); + writer.WriteNumberValue(StorageSizeInGbs.Value); + } + if (Optional.IsCollectionDefined(FileSystemConfigurationDetails)) + { + writer.WritePropertyName("fileSystemConfigurationDetails"u8); + writer.WriteStartArray(); + foreach (var item in FileSystemConfigurationDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DataStorageSizeInTbs)) + { + writer.WritePropertyName("dataStorageSizeInTbs"u8); + writer.WriteNumberValue(DataStorageSizeInTbs.Value); + } + if (Optional.IsDefined(DbNodeStorageSizeInGbs)) + { + writer.WritePropertyName("dbNodeStorageSizeInGbs"u8); + writer.WriteNumberValue(DbNodeStorageSizeInGbs.Value); + } + if (Optional.IsDefined(MemorySizeInGbs)) + { + writer.WritePropertyName("memorySizeInGbs"u8); + writer.WriteNumberValue(MemorySizeInGbs.Value); + } + if (Optional.IsDefined(CpuCoreCount)) + { + writer.WritePropertyName("cpuCoreCount"u8); + writer.WriteNumberValue(CpuCoreCount.Value); + } + if (Optional.IsDefined(OcpuCount)) + { + writer.WritePropertyName("ocpuCount"u8); + writer.WriteNumberValue(OcpuCount.Value); + } + if (Optional.IsCollectionDefined(SshPublicKeys)) + { + writer.WritePropertyName("sshPublicKeys"u8); + writer.WriteStartArray(); + foreach (var item in SshPublicKeys) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(LicenseModel)) + { + writer.WritePropertyName("licenseModel"u8); + writer.WriteStringValue(LicenseModel.Value.ToString()); + } + if (Optional.IsDefined(DataCollectionOptions)) + { + writer.WritePropertyName("dataCollectionOptions"u8); + writer.WriteObjectValue(DataCollectionOptions, options); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsCollectionDefined(ComputeNodes)) + { + writer.WritePropertyName("computeNodes"u8); + writer.WriteStartArray(); + foreach (var item in ComputeNodes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CloudVmClusterUpdateProperties 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(CloudVmClusterUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudVmClusterUpdateProperties(document.RootElement, options); + } + + internal static CloudVmClusterUpdateProperties DeserializeCloudVmClusterUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? storageSizeInGbs = default; + IList fileSystemConfigurationDetails = default; + double? dataStorageSizeInTbs = default; + int? dbNodeStorageSizeInGbs = default; + int? memorySizeInGbs = default; + int? cpuCoreCount = default; + float? ocpuCount = default; + IList sshPublicKeys = default; + LicenseModel? licenseModel = default; + DataCollectionOptions dataCollectionOptions = default; + string displayName = default; + IList computeNodes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("fileSystemConfigurationDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.FileSystemConfigurationDetails.DeserializeFileSystemConfigurationDetails(item, options)); + } + fileSystemConfigurationDetails = array; + continue; + } + if (property.NameEquals("dataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("dbNodeStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbNodeStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("memorySizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memorySizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("cpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("ocpuCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ocpuCount = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("sshPublicKeys"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sshPublicKeys = array; + continue; + } + if (property.NameEquals("licenseModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + licenseModel = new LicenseModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("dataCollectionOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataCollectionOptions = DataCollectionOptions.DeserializeDataCollectionOptions(property.Value, options); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("computeNodes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + computeNodes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CloudVmClusterUpdateProperties( + storageSizeInGbs, + fileSystemConfigurationDetails ?? new ChangeTrackingList(), + dataStorageSizeInTbs, + dbNodeStorageSizeInGbs, + memorySizeInGbs, + cpuCoreCount, + ocpuCount, + sshPublicKeys ?? new ChangeTrackingList(), + licenseModel, + dataCollectionOptions, + displayName, + computeNodes ?? 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); + default: + throw new FormatException($"The model {nameof(CloudVmClusterUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + CloudVmClusterUpdateProperties 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 DeserializeCloudVmClusterUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CloudVmClusterUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.cs new file mode 100644 index 000000000000..1df5f808d21d --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CloudVmClusterUpdateProperties.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// The updatable properties of the CloudVmCluster. + public partial class CloudVmClusterUpdateProperties + { + /// + /// 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 CloudVmClusterUpdateProperties() + { + FileSystemConfigurationDetails = new ChangeTrackingList(); + SshPublicKeys = new ChangeTrackingList(); + ComputeNodes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The data disk group size to be allocated in GBs per VM. + /// Array of mount path and size. + /// The data disk group size to be allocated in TBs. + /// The local node storage to be allocated in GBs. + /// The memory to be allocated in GBs. + /// The number of CPU cores enabled on the cloud VM cluster. + /// The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal place is allowed for the fractional part. + /// The public key portion of one or more key pairs used for SSH access to the cloud VM cluster. + /// The Oracle license model that applies to the cloud VM cluster. The default is LICENSE_INCLUDED. + /// Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + /// Display Name. + /// The list of compute servers to be added to the cloud VM cluster. + /// Keeps track of any properties unknown to the library. + internal CloudVmClusterUpdateProperties(int? storageSizeInGbs, IList fileSystemConfigurationDetails, double? dataStorageSizeInTbs, int? dbNodeStorageSizeInGbs, int? memorySizeInGbs, int? cpuCoreCount, float? ocpuCount, IList sshPublicKeys, LicenseModel? licenseModel, DataCollectionOptions dataCollectionOptions, string displayName, IList computeNodes, IDictionary serializedAdditionalRawData) + { + StorageSizeInGbs = storageSizeInGbs; + FileSystemConfigurationDetails = fileSystemConfigurationDetails; + DataStorageSizeInTbs = dataStorageSizeInTbs; + DbNodeStorageSizeInGbs = dbNodeStorageSizeInGbs; + MemorySizeInGbs = memorySizeInGbs; + CpuCoreCount = cpuCoreCount; + OcpuCount = ocpuCount; + SshPublicKeys = sshPublicKeys; + LicenseModel = licenseModel; + DataCollectionOptions = dataCollectionOptions; + DisplayName = displayName; + ComputeNodes = computeNodes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The data disk group size to be allocated in GBs per VM. + public int? StorageSizeInGbs { get; set; } + /// Array of mount path and size. + public IList FileSystemConfigurationDetails { get; } + /// The data disk group size to be allocated in TBs. + public double? DataStorageSizeInTbs { get; set; } + /// The local node storage to be allocated in GBs. + public int? DbNodeStorageSizeInGbs { get; set; } + /// The memory to be allocated in GBs. + public int? MemorySizeInGbs { get; set; } + /// The number of CPU cores enabled on the cloud VM cluster. + public int? CpuCoreCount { get; set; } + /// The number of OCPU cores to enable on the cloud VM cluster. Only 1 decimal place is allowed for the fractional part. + public float? OcpuCount { get; set; } + /// The public key portion of one or more key pairs used for SSH access to the cloud VM cluster. + public IList SshPublicKeys { get; } + /// The Oracle license model that applies to the cloud VM cluster. The default is LICENSE_INCLUDED. + public LicenseModel? LicenseModel { get; set; } + /// Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + public DataCollectionOptions DataCollectionOptions { get; set; } + /// Display Name. + public string DisplayName { get; set; } + /// The list of compute servers to be added to the cloud VM cluster. + public IList ComputeNodes { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ComputeModel.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ComputeModel.cs new file mode 100644 index 000000000000..d889e8abcbc6 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ComputeModel.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.OracleDatabase.Models +{ + /// Compute model enum. + public readonly partial struct ComputeModel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeModel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ECPUValue = "ECPU"; + private const string OCPUValue = "OCPU"; + + /// ECPU model type. + public static ComputeModel ECPU { get; } = new ComputeModel(ECPUValue); + /// OCPU model type. + public static ComputeModel OCPU { get; } = new ComputeModel(OCPUValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeModel left, ComputeModel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeModel left, ComputeModel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ComputeModel(string value) => new ComputeModel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeModel other && Equals(other); + /// + public bool Equals(ComputeModel 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionStringType.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionStringType.Serialization.cs new file mode 100644 index 000000000000..bb8b3e172eb3 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionStringType.Serialization.cs @@ -0,0 +1,209 @@ +// 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.OracleDatabase.Models +{ + public partial class ConnectionStringType : 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(ConnectionStringType)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AllConnectionStrings)) + { + writer.WritePropertyName("allConnectionStrings"u8); + writer.WriteObjectValue(AllConnectionStrings, options); + } + if (Optional.IsDefined(Dedicated)) + { + writer.WritePropertyName("dedicated"u8); + writer.WriteStringValue(Dedicated); + } + if (Optional.IsDefined(High)) + { + writer.WritePropertyName("high"u8); + writer.WriteStringValue(High); + } + if (Optional.IsDefined(Low)) + { + writer.WritePropertyName("low"u8); + writer.WriteStringValue(Low); + } + if (Optional.IsDefined(Medium)) + { + writer.WritePropertyName("medium"u8); + writer.WriteStringValue(Medium); + } + if (Optional.IsCollectionDefined(Profiles)) + { + writer.WritePropertyName("profiles"u8); + writer.WriteStartArray(); + foreach (var item in Profiles) + { + 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 + } + } + } + + ConnectionStringType 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(ConnectionStringType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionStringType(document.RootElement, options); + } + + internal static ConnectionStringType DeserializeConnectionStringType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AllConnectionStringType allConnectionStrings = default; + string dedicated = default; + string high = default; + string low = default; + string medium = default; + IReadOnlyList profiles = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("allConnectionStrings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allConnectionStrings = AllConnectionStringType.DeserializeAllConnectionStringType(property.Value, options); + continue; + } + if (property.NameEquals("dedicated"u8)) + { + dedicated = property.Value.GetString(); + continue; + } + if (property.NameEquals("high"u8)) + { + high = property.Value.GetString(); + continue; + } + if (property.NameEquals("low"u8)) + { + low = property.Value.GetString(); + continue; + } + if (property.NameEquals("medium"u8)) + { + medium = property.Value.GetString(); + continue; + } + if (property.NameEquals("profiles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ProfileType.DeserializeProfileType(item, options)); + } + profiles = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionStringType( + allConnectionStrings, + dedicated, + high, + low, + medium, + profiles ?? 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); + default: + throw new FormatException($"The model {nameof(ConnectionStringType)} does not support writing '{options.Format}' format."); + } + } + + ConnectionStringType 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 DeserializeConnectionStringType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionStringType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionStringType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionStringType.cs new file mode 100644 index 000000000000..75ab6f2bf445 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionStringType.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.OracleDatabase.Models +{ + /// Connection strings to connect to an Oracle Autonomous Database. + public partial class ConnectionStringType + { + /// + /// 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 ConnectionStringType() + { + Profiles = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Returns all connection strings that can be used to connect to the Autonomous Database. + /// The database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. + /// The High database service provides the highest level of resources to each SQL statement resulting in the highest performance, but supports the fewest number of concurrent SQL statements. + /// The Low database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. + /// The Medium database service provides a lower level of resources to each SQL statement potentially resulting a lower level of performance, but supports more concurrent SQL statements. + /// A list of connection string profiles to allow clients to group, filter and select connection string values based on structured metadata. + /// Keeps track of any properties unknown to the library. + internal ConnectionStringType(AllConnectionStringType allConnectionStrings, string dedicated, string high, string low, string medium, IReadOnlyList profiles, IDictionary serializedAdditionalRawData) + { + AllConnectionStrings = allConnectionStrings; + Dedicated = dedicated; + High = high; + Low = low; + Medium = medium; + Profiles = profiles; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Returns all connection strings that can be used to connect to the Autonomous Database. + public AllConnectionStringType AllConnectionStrings { get; } + /// The database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. + public string Dedicated { get; } + /// The High database service provides the highest level of resources to each SQL statement resulting in the highest performance, but supports the fewest number of concurrent SQL statements. + public string High { get; } + /// The Low database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. + public string Low { get; } + /// The Medium database service provides a lower level of resources to each SQL statement potentially resulting a lower level of performance, but supports more concurrent SQL statements. + public string Medium { get; } + /// A list of connection string profiles to allow clients to group, filter and select connection string values based on structured metadata. + public IReadOnlyList Profiles { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionUrlType.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionUrlType.Serialization.cs new file mode 100644 index 000000000000..5498a7a4699a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionUrlType.Serialization.cs @@ -0,0 +1,203 @@ +// 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.OracleDatabase.Models +{ + public partial class ConnectionUrlType : 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(ConnectionUrlType)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ApexUri)) + { + writer.WritePropertyName("apexUrl"u8); + writer.WriteStringValue(ApexUri); + } + if (Optional.IsDefined(DatabaseTransformsUri)) + { + writer.WritePropertyName("databaseTransformsUrl"u8); + writer.WriteStringValue(DatabaseTransformsUri); + } + if (Optional.IsDefined(GraphStudioUri)) + { + writer.WritePropertyName("graphStudioUrl"u8); + writer.WriteStringValue(GraphStudioUri); + } + if (Optional.IsDefined(MachineLearningNotebookUri)) + { + writer.WritePropertyName("machineLearningNotebookUrl"u8); + writer.WriteStringValue(MachineLearningNotebookUri); + } + if (Optional.IsDefined(MongoDbUri)) + { + writer.WritePropertyName("mongoDbUrl"u8); + writer.WriteStringValue(MongoDbUri); + } + if (Optional.IsDefined(OrdsUri)) + { + writer.WritePropertyName("ordsUrl"u8); + writer.WriteStringValue(OrdsUri); + } + if (Optional.IsDefined(SqlDevWebUri)) + { + writer.WritePropertyName("sqlDevWebUrl"u8); + writer.WriteStringValue(SqlDevWebUri); + } + 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 + } + } + } + + ConnectionUrlType 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(ConnectionUrlType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionUrlType(document.RootElement, options); + } + + internal static ConnectionUrlType DeserializeConnectionUrlType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string apexUrl = default; + string databaseTransformsUrl = default; + string graphStudioUrl = default; + string machineLearningNotebookUrl = default; + string mongoDbUrl = default; + string ordsUrl = default; + string sqlDevWebUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("apexUrl"u8)) + { + apexUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseTransformsUrl"u8)) + { + databaseTransformsUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("graphStudioUrl"u8)) + { + graphStudioUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("machineLearningNotebookUrl"u8)) + { + machineLearningNotebookUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("mongoDbUrl"u8)) + { + mongoDbUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("ordsUrl"u8)) + { + ordsUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("sqlDevWebUrl"u8)) + { + sqlDevWebUrl = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionUrlType( + apexUrl, + databaseTransformsUrl, + graphStudioUrl, + machineLearningNotebookUrl, + mongoDbUrl, + ordsUrl, + sqlDevWebUrl, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ConnectionUrlType)} does not support writing '{options.Format}' format."); + } + } + + ConnectionUrlType 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 DeserializeConnectionUrlType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionUrlType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionUrlType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionUrlType.cs new file mode 100644 index 000000000000..5694fc7e5b66 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConnectionUrlType.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.OracleDatabase.Models +{ + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + public partial class ConnectionUrlType + { + /// + /// 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 ConnectionUrlType() + { + } + + /// Initializes a new instance of . + /// Oracle Application Express (APEX) URL. + /// The URL of the Database Transforms for the Autonomous Database. + /// The URL of the Graph Studio for the Autonomous Database. + /// The URL of the Oracle Machine Learning (OML) Notebook for the Autonomous Database. + /// The URL of the MongoDB API for the Autonomous Database. + /// The Oracle REST Data Services (ORDS) URL of the Web Access for the Autonomous Database. + /// Oracle SQL Developer Web URL. + /// Keeps track of any properties unknown to the library. + internal ConnectionUrlType(string apexUri, string databaseTransformsUri, string graphStudioUri, string machineLearningNotebookUri, string mongoDbUri, string ordsUri, string sqlDevWebUri, IDictionary serializedAdditionalRawData) + { + ApexUri = apexUri; + DatabaseTransformsUri = databaseTransformsUri; + GraphStudioUri = graphStudioUri; + MachineLearningNotebookUri = machineLearningNotebookUri; + MongoDbUri = mongoDbUri; + OrdsUri = ordsUri; + SqlDevWebUri = sqlDevWebUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Oracle Application Express (APEX) URL. + public string ApexUri { get; } + /// The URL of the Database Transforms for the Autonomous Database. + public string DatabaseTransformsUri { get; } + /// The URL of the Graph Studio for the Autonomous Database. + public string GraphStudioUri { get; } + /// The URL of the Oracle Machine Learning (OML) Notebook for the Autonomous Database. + public string MachineLearningNotebookUri { get; } + /// The URL of the MongoDB API for the Autonomous Database. + public string MongoDbUri { get; } + /// The Oracle REST Data Services (ORDS) URL of the Web Access for the Autonomous Database. + public string OrdsUri { get; } + /// Oracle SQL Developer Web URL. + public string SqlDevWebUri { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConsumerGroup.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConsumerGroup.cs new file mode 100644 index 000000000000..d932177cd4ba --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ConsumerGroup.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Consumer group enum. + public readonly partial struct ConsumerGroup : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConsumerGroup(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HighValue = "High"; + private const string MediumValue = "Medium"; + private const string LowValue = "Low"; + private const string TpValue = "Tp"; + private const string TpurgentValue = "Tpurgent"; + + /// High group. + public static ConsumerGroup High { get; } = new ConsumerGroup(HighValue); + /// Medium group. + public static ConsumerGroup Medium { get; } = new ConsumerGroup(MediumValue); + /// Low group. + public static ConsumerGroup Low { get; } = new ConsumerGroup(LowValue); + /// TP group. + public static ConsumerGroup Tp { get; } = new ConsumerGroup(TpValue); + /// TPurgent group. + public static ConsumerGroup Tpurgent { get; } = new ConsumerGroup(TpurgentValue); + /// Determines if two values are the same. + public static bool operator ==(ConsumerGroup left, ConsumerGroup right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConsumerGroup left, ConsumerGroup right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConsumerGroup(string value) => new ConsumerGroup(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConsumerGroup other && Equals(other); + /// + public bool Equals(ConsumerGroup 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CustomerContact.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CustomerContact.Serialization.cs new file mode 100644 index 000000000000..cd8e5a53e107 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CustomerContact.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.OracleDatabase.Models +{ + public partial class CustomerContact : 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(CustomerContact)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("email"u8); + writer.WriteStringValue(Email); + 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 + } + } + } + + CustomerContact 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(CustomerContact)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomerContact(document.RootElement, options); + } + + internal static CustomerContact DeserializeCustomerContact(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string email = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("email"u8)) + { + email = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomerContact(email, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomerContact)} does not support writing '{options.Format}' format."); + } + } + + CustomerContact 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 DeserializeCustomerContact(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomerContact)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CustomerContact.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CustomerContact.cs new file mode 100644 index 000000000000..6a55a62855a3 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/CustomerContact.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.OracleDatabase.Models +{ + /// CustomerContact resource properties. + public partial class CustomerContact + { + /// + /// 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 email address used by Oracle to send notifications regarding databases and infrastructure. + /// is null. + public CustomerContact(string email) + { + Argument.AssertNotNull(email, nameof(email)); + + Email = email; + } + + /// Initializes a new instance of . + /// The email address used by Oracle to send notifications regarding databases and infrastructure. + /// Keeps track of any properties unknown to the library. + internal CustomerContact(string email, IDictionary serializedAdditionalRawData) + { + Email = email; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CustomerContact() + { + } + + /// The email address used by Oracle to send notifications regarding databases and infrastructure. + public string Email { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataBaseType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataBaseType.cs new file mode 100644 index 000000000000..b22a49836386 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataBaseType.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.OracleDatabase.Models +{ + /// Database type enum. + internal readonly partial struct DataBaseType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataBaseType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RegularValue = "Regular"; + private const string CloneValue = "Clone"; + private const string CloneFromBackupTimestampValue = "CloneFromBackupTimestamp"; + private const string CrossRegionDisasterRecoveryValue = "CrossRegionDisasterRecovery"; + + /// Regular DB. + public static DataBaseType Regular { get; } = new DataBaseType(RegularValue); + /// Clone DB. + public static DataBaseType Clone { get; } = new DataBaseType(CloneValue); + /// Clone DB from backup timestamp. + public static DataBaseType CloneFromBackupTimestamp { get; } = new DataBaseType(CloneFromBackupTimestampValue); + /// Cross Region Disaster Recovery. + public static DataBaseType CrossRegionDisasterRecovery { get; } = new DataBaseType(CrossRegionDisasterRecoveryValue); + /// Determines if two values are the same. + public static bool operator ==(DataBaseType left, DataBaseType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataBaseType left, DataBaseType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataBaseType(string value) => new DataBaseType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataBaseType other && Equals(other); + /// + public bool Equals(DataBaseType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataCollectionOptions.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataCollectionOptions.Serialization.cs new file mode 100644 index 000000000000..3fa3668e4a13 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataCollectionOptions.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.OracleDatabase.Models +{ + public partial class DataCollectionOptions : 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(DataCollectionOptions)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IsDiagnosticsEventsEnabled)) + { + writer.WritePropertyName("isDiagnosticsEventsEnabled"u8); + writer.WriteBooleanValue(IsDiagnosticsEventsEnabled.Value); + } + if (Optional.IsDefined(IsHealthMonitoringEnabled)) + { + writer.WritePropertyName("isHealthMonitoringEnabled"u8); + writer.WriteBooleanValue(IsHealthMonitoringEnabled.Value); + } + if (Optional.IsDefined(IsIncidentLogsEnabled)) + { + writer.WritePropertyName("isIncidentLogsEnabled"u8); + writer.WriteBooleanValue(IsIncidentLogsEnabled.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 + } + } + } + + DataCollectionOptions 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(DataCollectionOptions)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataCollectionOptions(document.RootElement, options); + } + + internal static DataCollectionOptions DeserializeDataCollectionOptions(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? isDiagnosticsEventsEnabled = default; + bool? isHealthMonitoringEnabled = default; + bool? isIncidentLogsEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("isDiagnosticsEventsEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDiagnosticsEventsEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isHealthMonitoringEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isHealthMonitoringEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isIncidentLogsEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isIncidentLogsEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataCollectionOptions(isDiagnosticsEventsEnabled, isHealthMonitoringEnabled, isIncidentLogsEnabled, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataCollectionOptions)} does not support writing '{options.Format}' format."); + } + } + + DataCollectionOptions 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 DeserializeDataCollectionOptions(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataCollectionOptions)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataCollectionOptions.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataCollectionOptions.cs new file mode 100644 index 000000000000..571ad7b990f1 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataCollectionOptions.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.OracleDatabase.Models +{ + /// DataCollectionOptions resource properties. + public partial class DataCollectionOptions + { + /// + /// 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 DataCollectionOptions() + { + } + + /// Initializes a new instance of . + /// Indicates whether diagnostic collection is enabled for the VM cluster/Cloud VM cluster/VMBM DBCS. + /// Indicates whether health monitoring is enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. + /// Indicates whether incident logs and trace collection are enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. + /// Keeps track of any properties unknown to the library. + internal DataCollectionOptions(bool? isDiagnosticsEventsEnabled, bool? isHealthMonitoringEnabled, bool? isIncidentLogsEnabled, IDictionary serializedAdditionalRawData) + { + IsDiagnosticsEventsEnabled = isDiagnosticsEventsEnabled; + IsHealthMonitoringEnabled = isHealthMonitoringEnabled; + IsIncidentLogsEnabled = isIncidentLogsEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates whether diagnostic collection is enabled for the VM cluster/Cloud VM cluster/VMBM DBCS. + public bool? IsDiagnosticsEventsEnabled { get; set; } + /// Indicates whether health monitoring is enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. + public bool? IsHealthMonitoringEnabled { get; set; } + /// Indicates whether incident logs and trace collection are enabled for the VM cluster / Cloud VM cluster / VMBM DBCS. + public bool? IsIncidentLogsEnabled { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataSafeStatusType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataSafeStatusType.cs new file mode 100644 index 000000000000..da7b8b1377a6 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DataSafeStatusType.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// DataSafe status type enum. + public readonly partial struct DataSafeStatusType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataSafeStatusType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RegisteringValue = "Registering"; + private const string RegisteredValue = "Registered"; + private const string DeregisteringValue = "Deregistering"; + private const string NotRegisteredValue = "NotRegistered"; + private const string FailedValue = "Failed"; + + /// Registering status. + public static DataSafeStatusType Registering { get; } = new DataSafeStatusType(RegisteringValue); + /// Registered status. + public static DataSafeStatusType Registered { get; } = new DataSafeStatusType(RegisteredValue); + /// Deregistering status. + public static DataSafeStatusType Deregistering { get; } = new DataSafeStatusType(DeregisteringValue); + /// NotRegistered status. + public static DataSafeStatusType NotRegistered { get; } = new DataSafeStatusType(NotRegisteredValue); + /// Failed status. + public static DataSafeStatusType Failed { get; } = new DataSafeStatusType(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(DataSafeStatusType left, DataSafeStatusType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataSafeStatusType left, DataSafeStatusType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataSafeStatusType(string value) => new DataSafeStatusType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataSafeStatusType other && Equals(other); + /// + public bool Equals(DataSafeStatusType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DatabaseEditionType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DatabaseEditionType.cs new file mode 100644 index 000000000000..90f1ad605b20 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DatabaseEditionType.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.OracleDatabase.Models +{ + /// Database edition type enum. + public readonly partial struct DatabaseEditionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DatabaseEditionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StandardEditionValue = "StandardEdition"; + private const string EnterpriseEditionValue = "EnterpriseEdition"; + + /// Standard edition. + public static DatabaseEditionType StandardEdition { get; } = new DatabaseEditionType(StandardEditionValue); + /// Enterprise edition. + public static DatabaseEditionType EnterpriseEdition { get; } = new DatabaseEditionType(EnterpriseEditionValue); + /// Determines if two values are the same. + public static bool operator ==(DatabaseEditionType left, DatabaseEditionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DatabaseEditionType left, DatabaseEditionType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DatabaseEditionType(string value) => new DatabaseEditionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DatabaseEditionType other && Equals(other); + /// + public bool Equals(DatabaseEditionType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DayOfWeek.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DayOfWeek.Serialization.cs new file mode 100644 index 000000000000..2c50ea07e73e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DayOfWeek.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.OracleDatabase.Models +{ + public partial class DayOfWeek : 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(DayOfWeek)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.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 + } + } + } + + DayOfWeek 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(DayOfWeek)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDayOfWeek(document.RootElement, options); + } + + internal static DayOfWeek DeserializeDayOfWeek(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DayOfWeekName name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = new DayOfWeekName(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DayOfWeek(name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DayOfWeek)} does not support writing '{options.Format}' format."); + } + } + + DayOfWeek 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 DeserializeDayOfWeek(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DayOfWeek)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DayOfWeek.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DayOfWeek.cs new file mode 100644 index 000000000000..e3944168f9c3 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DayOfWeek.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// DayOfWeek resource properties. + public partial class DayOfWeek + { + /// + /// 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 . + /// Name of the day of the week. + public DayOfWeek(DayOfWeekName name) + { + Name = name; + } + + /// Initializes a new instance of . + /// Name of the day of the week. + /// Keeps track of any properties unknown to the library. + internal DayOfWeek(DayOfWeekName name, IDictionary serializedAdditionalRawData) + { + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DayOfWeek() + { + } + + /// Name of the day of the week. + public DayOfWeekName Name { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DayOfWeekName.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DayOfWeekName.cs new file mode 100644 index 000000000000..64fb9de7b1ca --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DayOfWeekName.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.OracleDatabase.Models +{ + /// DayOfWeekName enum. + public readonly partial struct DayOfWeekName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DayOfWeekName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MondayValue = "Monday"; + private const string TuesdayValue = "Tuesday"; + private const string WednesdayValue = "Wednesday"; + private const string ThursdayValue = "Thursday"; + private const string FridayValue = "Friday"; + private const string SaturdayValue = "Saturday"; + private const string SundayValue = "Sunday"; + + /// Monday value. + public static DayOfWeekName Monday { get; } = new DayOfWeekName(MondayValue); + /// Tuesday value. + public static DayOfWeekName Tuesday { get; } = new DayOfWeekName(TuesdayValue); + /// Wednesday value. + public static DayOfWeekName Wednesday { get; } = new DayOfWeekName(WednesdayValue); + /// Thursday value. + public static DayOfWeekName Thursday { get; } = new DayOfWeekName(ThursdayValue); + /// Friday value. + public static DayOfWeekName Friday { get; } = new DayOfWeekName(FridayValue); + /// Saturday value. + public static DayOfWeekName Saturday { get; } = new DayOfWeekName(SaturdayValue); + /// Sunday value. + public static DayOfWeekName Sunday { get; } = new DayOfWeekName(SundayValue); + /// Determines if two values are the same. + public static bool operator ==(DayOfWeekName left, DayOfWeekName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DayOfWeekName left, DayOfWeekName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DayOfWeekName(string value) => new DayOfWeekName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DayOfWeekName other && Equals(other); + /// + public bool Equals(DayOfWeekName 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbActionResponse.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbActionResponse.Serialization.cs new file mode 100644 index 000000000000..3c1de1fcc75b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbActionResponse.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.OracleDatabase.Models +{ + public partial class DbActionResponse : 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(DbActionResponse)} does not support writing '{format}' format."); + } + + if (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 + } + } + } + + DbActionResponse 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(DbActionResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDbActionResponse(document.RootElement, options); + } + + internal static DbActionResponse DeserializeDbActionResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureResourceProvisioningState? provisioningState = 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 AzureResourceProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DbActionResponse(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); + default: + throw new FormatException($"The model {nameof(DbActionResponse)} does not support writing '{options.Format}' format."); + } + } + + DbActionResponse 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 DeserializeDbActionResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DbActionResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbActionResponse.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbActionResponse.cs new file mode 100644 index 000000000000..52704da4539e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbActionResponse.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// ExascaleDbNode action response. + public partial class DbActionResponse + { + /// + /// 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 DbActionResponse() + { + } + + /// Initializes a new instance of . + /// ExascaleDbNode provisioning state. + /// Keeps track of any properties unknown to the library. + internal DbActionResponse(AzureResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// ExascaleDbNode provisioning state. + public AzureResourceProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbIormConfig.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbIormConfig.Serialization.cs new file mode 100644 index 000000000000..383447551bc4 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbIormConfig.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.OracleDatabase.Models +{ + public partial class DbIormConfig : 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(DbIormConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DbName)) + { + writer.WritePropertyName("dbName"u8); + writer.WriteStringValue(DbName); + } + if (Optional.IsDefined(FlashCacheLimit)) + { + writer.WritePropertyName("flashCacheLimit"u8); + writer.WriteStringValue(FlashCacheLimit); + } + if (Optional.IsDefined(Share)) + { + writer.WritePropertyName("share"u8); + writer.WriteNumberValue(Share.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 + } + } + } + + DbIormConfig 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(DbIormConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDbIormConfig(document.RootElement, options); + } + + internal static DbIormConfig DeserializeDbIormConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string dbName = default; + string flashCacheLimit = default; + int? share = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dbName"u8)) + { + dbName = property.Value.GetString(); + continue; + } + if (property.NameEquals("flashCacheLimit"u8)) + { + flashCacheLimit = property.Value.GetString(); + continue; + } + if (property.NameEquals("share"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + share = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DbIormConfig(dbName, flashCacheLimit, share, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DbIormConfig)} does not support writing '{options.Format}' format."); + } + } + + DbIormConfig 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 DeserializeDbIormConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DbIormConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbIormConfig.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbIormConfig.cs new file mode 100644 index 000000000000..b655ba39fba3 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbIormConfig.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.OracleDatabase.Models +{ + /// DbIormConfig for cloud vm cluster. + public partial class DbIormConfig + { + /// + /// 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 DbIormConfig() + { + } + + /// Initializes a new instance of . + /// The database name. For the default DbPlan, the dbName is default. + /// The flash cache limit for this database. This value is internally configured based on the share value assigned to the database. + /// The relative priority of this database. + /// Keeps track of any properties unknown to the library. + internal DbIormConfig(string dbName, string flashCacheLimit, int? share, IDictionary serializedAdditionalRawData) + { + DbName = dbName; + FlashCacheLimit = flashCacheLimit; + Share = share; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The database name. For the default DbPlan, the dbName is default. + public string DbName { get; } + /// The flash cache limit for this database. This value is internally configured based on the share value assigned to the database. + public string FlashCacheLimit { get; } + /// The relative priority of this database. + public int? Share { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeAction.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeAction.Serialization.cs new file mode 100644 index 000000000000..58f581561bc9 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeAction.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.OracleDatabase.Models +{ + public partial class DbNodeAction : 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(DbNodeAction)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.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 + } + } + } + + DbNodeAction 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(DbNodeAction)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDbNodeAction(document.RootElement, options); + } + + internal static DbNodeAction DeserializeDbNodeAction(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DbNodeActionEnum action = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("action"u8)) + { + action = new DbNodeActionEnum(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DbNodeAction(action, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DbNodeAction)} does not support writing '{options.Format}' format."); + } + } + + DbNodeAction 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 DeserializeDbNodeAction(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DbNodeAction)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeAction.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeAction.cs new file mode 100644 index 000000000000..beadeeb0650c --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeAction.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// DbNode action object. + public partial class DbNodeAction + { + /// + /// 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 . + /// Db action. + public DbNodeAction(DbNodeActionEnum action) + { + Action = action; + } + + /// Initializes a new instance of . + /// Db action. + /// Keeps track of any properties unknown to the library. + internal DbNodeAction(DbNodeActionEnum action, IDictionary serializedAdditionalRawData) + { + Action = action; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DbNodeAction() + { + } + + /// Db action. + public DbNodeActionEnum Action { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeActionEnum.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeActionEnum.cs new file mode 100644 index 000000000000..19da3a58571a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeActionEnum.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.OracleDatabase.Models +{ + /// DbNode action enum. + public readonly partial struct DbNodeActionEnum : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DbNodeActionEnum(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StartValue = "Start"; + private const string StopValue = "Stop"; + private const string SoftResetValue = "SoftReset"; + private const string ResetValue = "Reset"; + + /// Start DbNode. + public static DbNodeActionEnum Start { get; } = new DbNodeActionEnum(StartValue); + /// Stop DbNode. + public static DbNodeActionEnum Stop { get; } = new DbNodeActionEnum(StopValue); + /// Soft reset DbNode. + public static DbNodeActionEnum SoftReset { get; } = new DbNodeActionEnum(SoftResetValue); + /// Reset DbNode. + public static DbNodeActionEnum Reset { get; } = new DbNodeActionEnum(ResetValue); + /// Determines if two values are the same. + public static bool operator ==(DbNodeActionEnum left, DbNodeActionEnum right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DbNodeActionEnum left, DbNodeActionEnum right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DbNodeActionEnum(string value) => new DbNodeActionEnum(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DbNodeActionEnum other && Equals(other); + /// + public bool Equals(DbNodeActionEnum 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeDetails.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeDetails.Serialization.cs new file mode 100644 index 000000000000..1e8b548dee0f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeDetails.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.OracleDatabase.Models +{ + public partial class DbNodeDetails : 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(DbNodeDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("dbNodeId"u8); + writer.WriteStringValue(DbNodeId); + 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 + } + } + } + + DbNodeDetails 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(DbNodeDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDbNodeDetails(document.RootElement, options); + } + + internal static DbNodeDetails DeserializeDbNodeDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier dbNodeId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dbNodeId"u8)) + { + dbNodeId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DbNodeDetails(dbNodeId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DbNodeDetails)} does not support writing '{options.Format}' format."); + } + } + + DbNodeDetails 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 DeserializeDbNodeDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DbNodeDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeDetails.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeDetails.cs new file mode 100644 index 000000000000..6fe226c3c4a0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeDetails.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; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Details of the ExaCS Db node. Applies to Exadata Database Service on Exascale Infrastructure only. + public partial class DbNodeDetails + { + /// + /// 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 . + /// Exascale DbNode Azure Resource ID. + /// is null. + public DbNodeDetails(ResourceIdentifier dbNodeId) + { + Argument.AssertNotNull(dbNodeId, nameof(dbNodeId)); + + DbNodeId = dbNodeId; + } + + /// Initializes a new instance of . + /// Exascale DbNode Azure Resource ID. + /// Keeps track of any properties unknown to the library. + internal DbNodeDetails(ResourceIdentifier dbNodeId, IDictionary serializedAdditionalRawData) + { + DbNodeId = dbNodeId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DbNodeDetails() + { + } + + /// Exascale DbNode Azure Resource ID. + public ResourceIdentifier DbNodeId { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeListResult.Serialization.cs new file mode 100644 index 000000000000..545d4b83b4e6 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeListResult.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.OracleDatabase.Models +{ + internal partial class DbNodeListResult : 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(DbNodeListResult)} 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 + } + } + } + + DbNodeListResult 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(DbNodeListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDbNodeListResult(document.RootElement, options); + } + + internal static DbNodeListResult DeserializeDbNodeListResult(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(DbNodeData.DeserializeDbNodeData(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 DbNodeListResult(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); + default: + throw new FormatException($"The model {nameof(DbNodeListResult)} does not support writing '{options.Format}' format."); + } + } + + DbNodeListResult 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 DeserializeDbNodeListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DbNodeListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeListResult.cs new file mode 100644 index 000000000000..e2a976acb24a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeListResult.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.OracleDatabase.Models +{ + /// The response of a DbNode list operation. + internal partial class DbNodeListResult + { + /// + /// 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 DbNode items on this page. + /// is null. + internal DbNodeListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The DbNode items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DbNodeListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DbNodeListResult() + { + } + + /// The DbNode items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeMaintenanceType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeMaintenanceType.cs new file mode 100644 index 000000000000..ffc9cb881a87 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeMaintenanceType.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.OracleDatabase.Models +{ + /// The type of database node maintenance. + public readonly partial struct DbNodeMaintenanceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DbNodeMaintenanceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string VmdbRebootMigrationValue = "VmdbRebootMigration"; + + /// VMDB reboot migration maintenance type. + public static DbNodeMaintenanceType VmdbRebootMigration { get; } = new DbNodeMaintenanceType(VmdbRebootMigrationValue); + /// Determines if two values are the same. + public static bool operator ==(DbNodeMaintenanceType left, DbNodeMaintenanceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DbNodeMaintenanceType left, DbNodeMaintenanceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DbNodeMaintenanceType(string value) => new DbNodeMaintenanceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DbNodeMaintenanceType other && Equals(other); + /// + public bool Equals(DbNodeMaintenanceType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeProperties.Serialization.cs new file mode 100644 index 000000000000..4fba14fcd2b0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeProperties.Serialization.cs @@ -0,0 +1,412 @@ +// 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.OracleDatabase.Models +{ + public partial class DbNodeProperties : 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(DbNodeProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + if (Optional.IsDefined(AdditionalDetails)) + { + writer.WritePropertyName("additionalDetails"u8); + writer.WriteStringValue(AdditionalDetails); + } + if (Optional.IsDefined(BackupIPId)) + { + writer.WritePropertyName("backupIpId"u8); + writer.WriteStringValue(BackupIPId); + } + if (Optional.IsDefined(BackupVnic2Id)) + { + writer.WritePropertyName("backupVnic2Id"u8); + writer.WriteStringValue(BackupVnic2Id); + } + if (Optional.IsDefined(BackupVnicId)) + { + writer.WritePropertyName("backupVnicId"u8); + writer.WriteStringValue(BackupVnicId); + } + if (Optional.IsDefined(CpuCoreCount)) + { + writer.WritePropertyName("cpuCoreCount"u8); + writer.WriteNumberValue(CpuCoreCount.Value); + } + if (Optional.IsDefined(DbNodeStorageSizeInGbs)) + { + writer.WritePropertyName("dbNodeStorageSizeInGbs"u8); + writer.WriteNumberValue(DbNodeStorageSizeInGbs.Value); + } + if (Optional.IsDefined(DbServerId)) + { + writer.WritePropertyName("dbServerId"u8); + writer.WriteStringValue(DbServerId); + } + writer.WritePropertyName("dbSystemId"u8); + writer.WriteStringValue(DbSystemId); + if (Optional.IsDefined(FaultDomain)) + { + writer.WritePropertyName("faultDomain"u8); + writer.WriteStringValue(FaultDomain); + } + if (Optional.IsDefined(HostIPId)) + { + writer.WritePropertyName("hostIpId"u8); + writer.WriteStringValue(HostIPId); + } + if (Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + } + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.ToString()); + if (Optional.IsDefined(LifecycleDetails)) + { + writer.WritePropertyName("lifecycleDetails"u8); + writer.WriteStringValue(LifecycleDetails); + } + if (Optional.IsDefined(MaintenanceType)) + { + writer.WritePropertyName("maintenanceType"u8); + writer.WriteStringValue(MaintenanceType.Value.ToString()); + } + if (Optional.IsDefined(MemorySizeInGbs)) + { + writer.WritePropertyName("memorySizeInGbs"u8); + writer.WriteNumberValue(MemorySizeInGbs.Value); + } + if (Optional.IsDefined(SoftwareStorageSizeInGb)) + { + writer.WritePropertyName("softwareStorageSizeInGb"u8); + writer.WriteNumberValue(SoftwareStorageSizeInGb.Value); + } + writer.WritePropertyName("timeCreated"u8); + writer.WriteStringValue(TimeCreated, "O"); + if (Optional.IsDefined(TimeMaintenanceWindowEnd)) + { + writer.WritePropertyName("timeMaintenanceWindowEnd"u8); + writer.WriteStringValue(TimeMaintenanceWindowEnd.Value, "O"); + } + if (Optional.IsDefined(TimeMaintenanceWindowStart)) + { + writer.WritePropertyName("timeMaintenanceWindowStart"u8); + writer.WriteStringValue(TimeMaintenanceWindowStart.Value, "O"); + } + if (Optional.IsDefined(Vnic2Id)) + { + writer.WritePropertyName("vnic2Id"u8); + writer.WriteStringValue(Vnic2Id); + } + writer.WritePropertyName("vnicId"u8); + writer.WriteStringValue(VnicId); + 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 + } + } + } + + DbNodeProperties 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(DbNodeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDbNodeProperties(document.RootElement, options); + } + + internal static DbNodeProperties DeserializeDbNodeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string ocid = default; + string additionalDetails = default; + string backupIPId = default; + string backupVnic2Id = default; + string backupVnicId = default; + int? cpuCoreCount = default; + int? dbNodeStorageSizeInGbs = default; + string dbServerId = default; + string dbSystemId = default; + string faultDomain = default; + string hostIPId = default; + string hostname = default; + DbNodeProvisioningState lifecycleState = default; + string lifecycleDetails = default; + DbNodeMaintenanceType? maintenanceType = default; + int? memorySizeInGbs = default; + int? softwareStorageSizeInGb = default; + DateTimeOffset timeCreated = default; + DateTimeOffset? timeMaintenanceWindowEnd = default; + DateTimeOffset? timeMaintenanceWindowStart = default; + string vnic2Id = default; + string vnicId = default; + ResourceProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("additionalDetails"u8)) + { + additionalDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("backupIpId"u8)) + { + backupIPId = property.Value.GetString(); + continue; + } + if (property.NameEquals("backupVnic2Id"u8)) + { + backupVnic2Id = property.Value.GetString(); + continue; + } + if (property.NameEquals("backupVnicId"u8)) + { + backupVnicId = property.Value.GetString(); + continue; + } + if (property.NameEquals("cpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dbNodeStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbNodeStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dbServerId"u8)) + { + dbServerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("dbSystemId"u8)) + { + dbSystemId = property.Value.GetString(); + continue; + } + if (property.NameEquals("faultDomain"u8)) + { + faultDomain = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostIpId"u8)) + { + hostIPId = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + lifecycleState = new DbNodeProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("maintenanceType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maintenanceType = new DbNodeMaintenanceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("memorySizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memorySizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("softwareStorageSizeInGb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softwareStorageSizeInGb = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceWindowEnd"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceWindowEnd = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceWindowStart"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceWindowStart = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("vnic2Id"u8)) + { + vnic2Id = property.Value.GetString(); + continue; + } + if (property.NameEquals("vnicId"u8)) + { + vnicId = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ResourceProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DbNodeProperties( + ocid, + additionalDetails, + backupIPId, + backupVnic2Id, + backupVnicId, + cpuCoreCount, + dbNodeStorageSizeInGbs, + dbServerId, + dbSystemId, + faultDomain, + hostIPId, + hostname, + lifecycleState, + lifecycleDetails, + maintenanceType, + memorySizeInGbs, + softwareStorageSizeInGb, + timeCreated, + timeMaintenanceWindowEnd, + timeMaintenanceWindowStart, + vnic2Id, + vnicId, + 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); + default: + throw new FormatException($"The model {nameof(DbNodeProperties)} does not support writing '{options.Format}' format."); + } + } + + DbNodeProperties 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 DeserializeDbNodeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DbNodeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeProperties.cs new file mode 100644 index 000000000000..83ccd26bb21b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeProperties.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// The properties of DbNodeResource. + public partial class DbNodeProperties + { + /// + /// 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 . + /// DbNode OCID. + /// The OCID of the DB system. + /// The current state of the database node. + /// The date and time that the database node was created. + /// The OCID of the VNIC. + /// , or is null. + internal DbNodeProperties(string ocid, string dbSystemId, DbNodeProvisioningState lifecycleState, DateTimeOffset timeCreated, string vnicId) + { + Argument.AssertNotNull(ocid, nameof(ocid)); + Argument.AssertNotNull(dbSystemId, nameof(dbSystemId)); + Argument.AssertNotNull(vnicId, nameof(vnicId)); + + Ocid = ocid; + DbSystemId = dbSystemId; + LifecycleState = lifecycleState; + TimeCreated = timeCreated; + VnicId = vnicId; + } + + /// Initializes a new instance of . + /// DbNode OCID. + /// Additional information about the planned maintenance. + /// The OCID of the backup IP address associated with the database node. + /// The OCID of the second backup VNIC. + /// The OCID of the backup VNIC. + /// The number of CPU cores enabled on the Db node. + /// The allocated local node storage in GBs on the Db node. + /// The OCID of the Exacc Db server associated with the database node. + /// The OCID of the DB system. + /// The name of the Fault Domain the instance is contained in. + /// The OCID of the host IP address associated with the database node. + /// The host name for the database node. + /// The current state of the database node. + /// Lifecycle details of Db Node. + /// The type of database node maintenance. + /// The allocated memory in GBs on the Db node. + /// The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine DB systems. + /// The date and time that the database node was created. + /// End date and time of maintenance window. + /// Start date and time of maintenance window. + /// The OCID of the second VNIC. + /// The OCID of the VNIC. + /// Azure resource provisioning state. + /// Keeps track of any properties unknown to the library. + internal DbNodeProperties(string ocid, string additionalDetails, string backupIPId, string backupVnic2Id, string backupVnicId, int? cpuCoreCount, int? dbNodeStorageSizeInGbs, string dbServerId, string dbSystemId, string faultDomain, string hostIPId, string hostname, DbNodeProvisioningState lifecycleState, string lifecycleDetails, DbNodeMaintenanceType? maintenanceType, int? memorySizeInGbs, int? softwareStorageSizeInGb, DateTimeOffset timeCreated, DateTimeOffset? timeMaintenanceWindowEnd, DateTimeOffset? timeMaintenanceWindowStart, string vnic2Id, string vnicId, ResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Ocid = ocid; + AdditionalDetails = additionalDetails; + BackupIPId = backupIPId; + BackupVnic2Id = backupVnic2Id; + BackupVnicId = backupVnicId; + CpuCoreCount = cpuCoreCount; + DbNodeStorageSizeInGbs = dbNodeStorageSizeInGbs; + DbServerId = dbServerId; + DbSystemId = dbSystemId; + FaultDomain = faultDomain; + HostIPId = hostIPId; + Hostname = hostname; + LifecycleState = lifecycleState; + LifecycleDetails = lifecycleDetails; + MaintenanceType = maintenanceType; + MemorySizeInGbs = memorySizeInGbs; + SoftwareStorageSizeInGb = softwareStorageSizeInGb; + TimeCreated = timeCreated; + TimeMaintenanceWindowEnd = timeMaintenanceWindowEnd; + TimeMaintenanceWindowStart = timeMaintenanceWindowStart; + Vnic2Id = vnic2Id; + VnicId = vnicId; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DbNodeProperties() + { + } + + /// DbNode OCID. + public string Ocid { get; } + /// Additional information about the planned maintenance. + public string AdditionalDetails { get; } + /// The OCID of the backup IP address associated with the database node. + public string BackupIPId { get; } + /// The OCID of the second backup VNIC. + public string BackupVnic2Id { get; } + /// The OCID of the backup VNIC. + public string BackupVnicId { get; } + /// The number of CPU cores enabled on the Db node. + public int? CpuCoreCount { get; } + /// The allocated local node storage in GBs on the Db node. + public int? DbNodeStorageSizeInGbs { get; } + /// The OCID of the Exacc Db server associated with the database node. + public string DbServerId { get; } + /// The OCID of the DB system. + public string DbSystemId { get; } + /// The name of the Fault Domain the instance is contained in. + public string FaultDomain { get; } + /// The OCID of the host IP address associated with the database node. + public string HostIPId { get; } + /// The host name for the database node. + public string Hostname { get; } + /// The current state of the database node. + public DbNodeProvisioningState LifecycleState { get; } + /// Lifecycle details of Db Node. + public string LifecycleDetails { get; } + /// The type of database node maintenance. + public DbNodeMaintenanceType? MaintenanceType { get; } + /// The allocated memory in GBs on the Db node. + public int? MemorySizeInGbs { get; } + /// The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine DB systems. + public int? SoftwareStorageSizeInGb { get; } + /// The date and time that the database node was created. + public DateTimeOffset TimeCreated { get; } + /// End date and time of maintenance window. + public DateTimeOffset? TimeMaintenanceWindowEnd { get; } + /// Start date and time of maintenance window. + public DateTimeOffset? TimeMaintenanceWindowStart { get; } + /// The OCID of the second VNIC. + public string Vnic2Id { get; } + /// The OCID of the VNIC. + public string VnicId { get; } + /// Azure resource provisioning state. + public ResourceProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeProvisioningState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeProvisioningState.cs new file mode 100644 index 000000000000..ad00956249a8 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbNodeProvisioningState.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.OracleDatabase.Models +{ + /// DnNode provisioning state enum. + public readonly partial struct DbNodeProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DbNodeProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProvisioningValue = "Provisioning"; + private const string AvailableValue = "Available"; + private const string UpdatingValue = "Updating"; + private const string StoppingValue = "Stopping"; + private const string StoppedValue = "Stopped"; + private const string StartingValue = "Starting"; + private const string TerminatingValue = "Terminating"; + private const string TerminatedValue = "Terminated"; + private const string FailedValue = "Failed"; + + /// Indicates that resource in Provisioning state. + public static DbNodeProvisioningState Provisioning { get; } = new DbNodeProvisioningState(ProvisioningValue); + /// Indicates that resource in Available state. + public static DbNodeProvisioningState Available { get; } = new DbNodeProvisioningState(AvailableValue); + /// Indicates that resource in Updating state. + public static DbNodeProvisioningState Updating { get; } = new DbNodeProvisioningState(UpdatingValue); + /// Indicates that resource in Stopping state. + public static DbNodeProvisioningState Stopping { get; } = new DbNodeProvisioningState(StoppingValue); + /// Indicates that resource in Stopped state. + public static DbNodeProvisioningState Stopped { get; } = new DbNodeProvisioningState(StoppedValue); + /// Indicates that resource in Starting state. + public static DbNodeProvisioningState Starting { get; } = new DbNodeProvisioningState(StartingValue); + /// Indicates that resource in Terminating state. + public static DbNodeProvisioningState Terminating { get; } = new DbNodeProvisioningState(TerminatingValue); + /// Indicates that resource in Terminated state. + public static DbNodeProvisioningState Terminated { get; } = new DbNodeProvisioningState(TerminatedValue); + /// Indicates that resource in Failed state. + public static DbNodeProvisioningState Failed { get; } = new DbNodeProvisioningState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(DbNodeProvisioningState left, DbNodeProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DbNodeProvisioningState left, DbNodeProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DbNodeProvisioningState(string value) => new DbNodeProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DbNodeProvisioningState other && Equals(other); + /// + public bool Equals(DbNodeProvisioningState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerListResult.Serialization.cs new file mode 100644 index 000000000000..72adb95d62dd --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerListResult.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.OracleDatabase.Models +{ + internal partial class DbServerListResult : 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(DbServerListResult)} 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 + } + } + } + + DbServerListResult 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(DbServerListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDbServerListResult(document.RootElement, options); + } + + internal static DbServerListResult DeserializeDbServerListResult(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(DbServerData.DeserializeDbServerData(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 DbServerListResult(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); + default: + throw new FormatException($"The model {nameof(DbServerListResult)} does not support writing '{options.Format}' format."); + } + } + + DbServerListResult 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 DeserializeDbServerListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DbServerListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerListResult.cs new file mode 100644 index 000000000000..6c677370ca74 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerListResult.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.OracleDatabase.Models +{ + /// The response of a DbServer list operation. + internal partial class DbServerListResult + { + /// + /// 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 DbServer items on this page. + /// is null. + internal DbServerListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The DbServer items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DbServerListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DbServerListResult() + { + } + + /// The DbServer items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerPatchingDetails.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerPatchingDetails.Serialization.cs new file mode 100644 index 000000000000..01e64f42921a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerPatchingDetails.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.OracleDatabase.Models +{ + public partial class DbServerPatchingDetails : 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(DbServerPatchingDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(EstimatedPatchDuration)) + { + writer.WritePropertyName("estimatedPatchDuration"u8); + writer.WriteNumberValue(EstimatedPatchDuration.Value); + } + if (options.Format != "W" && Optional.IsDefined(PatchingStatus)) + { + writer.WritePropertyName("patchingStatus"u8); + writer.WriteStringValue(PatchingStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TimePatchingEnded)) + { + writer.WritePropertyName("timePatchingEnded"u8); + writer.WriteStringValue(TimePatchingEnded.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(TimePatchingStarted)) + { + writer.WritePropertyName("timePatchingStarted"u8); + writer.WriteStringValue(TimePatchingStarted.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 + } + } + } + + DbServerPatchingDetails 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(DbServerPatchingDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDbServerPatchingDetails(document.RootElement, options); + } + + internal static DbServerPatchingDetails DeserializeDbServerPatchingDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? estimatedPatchDuration = default; + DbServerPatchingStatus? patchingStatus = default; + DateTimeOffset? timePatchingEnded = default; + DateTimeOffset? timePatchingStarted = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("estimatedPatchDuration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + estimatedPatchDuration = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("patchingStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchingStatus = new DbServerPatchingStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("timePatchingEnded"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timePatchingEnded = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timePatchingStarted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timePatchingStarted = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DbServerPatchingDetails(estimatedPatchDuration, patchingStatus, timePatchingEnded, timePatchingStarted, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DbServerPatchingDetails)} does not support writing '{options.Format}' format."); + } + } + + DbServerPatchingDetails 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 DeserializeDbServerPatchingDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DbServerPatchingDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerPatchingDetails.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerPatchingDetails.cs new file mode 100644 index 000000000000..2e95b08d90d1 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerPatchingDetails.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// DbServer Patching Properties. + public partial class DbServerPatchingDetails + { + /// + /// 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 DbServerPatchingDetails() + { + } + + /// Initializes a new instance of . + /// Estimated Patch Duration. + /// Patching Status. + /// Time Patching Ended. + /// Time Patching Started. + /// Keeps track of any properties unknown to the library. + internal DbServerPatchingDetails(int? estimatedPatchDuration, DbServerPatchingStatus? patchingStatus, DateTimeOffset? timePatchingEnded, DateTimeOffset? timePatchingStarted, IDictionary serializedAdditionalRawData) + { + EstimatedPatchDuration = estimatedPatchDuration; + PatchingStatus = patchingStatus; + TimePatchingEnded = timePatchingEnded; + TimePatchingStarted = timePatchingStarted; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Estimated Patch Duration. + public int? EstimatedPatchDuration { get; } + /// Patching Status. + public DbServerPatchingStatus? PatchingStatus { get; } + /// Time Patching Ended. + public DateTimeOffset? TimePatchingEnded { get; } + /// Time Patching Started. + public DateTimeOffset? TimePatchingStarted { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerPatchingStatus.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerPatchingStatus.cs new file mode 100644 index 000000000000..5534a53c7372 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerPatchingStatus.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.OracleDatabase.Models +{ + /// DB Server patching status enum. + public readonly partial struct DbServerPatchingStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DbServerPatchingStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ScheduledValue = "Scheduled"; + private const string MaintenanceInProgressValue = "MaintenanceInProgress"; + private const string FailedValue = "Failed"; + private const string CompleteValue = "Complete"; + + /// Patching scheduled. + public static DbServerPatchingStatus Scheduled { get; } = new DbServerPatchingStatus(ScheduledValue); + /// Patching in progress. + public static DbServerPatchingStatus MaintenanceInProgress { get; } = new DbServerPatchingStatus(MaintenanceInProgressValue); + /// Patching failed. + public static DbServerPatchingStatus Failed { get; } = new DbServerPatchingStatus(FailedValue); + /// Patching completed. + public static DbServerPatchingStatus Complete { get; } = new DbServerPatchingStatus(CompleteValue); + /// Determines if two values are the same. + public static bool operator ==(DbServerPatchingStatus left, DbServerPatchingStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DbServerPatchingStatus left, DbServerPatchingStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DbServerPatchingStatus(string value) => new DbServerPatchingStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DbServerPatchingStatus other && Equals(other); + /// + public bool Equals(DbServerPatchingStatus 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerProperties.Serialization.cs new file mode 100644 index 000000000000..b2002e6002ba --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerProperties.Serialization.cs @@ -0,0 +1,471 @@ +// 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.OracleDatabase.Models +{ + public partial class DbServerProperties : 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(DbServerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Ocid)) + { + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(CompartmentId)) + { + writer.WritePropertyName("compartmentId"u8); + writer.WriteStringValue(CompartmentId); + } + if (options.Format != "W" && Optional.IsDefined(ExadataInfrastructureId)) + { + writer.WritePropertyName("exadataInfrastructureId"u8); + writer.WriteStringValue(ExadataInfrastructureId); + } + if (options.Format != "W" && Optional.IsDefined(CpuCoreCount)) + { + writer.WritePropertyName("cpuCoreCount"u8); + writer.WriteNumberValue(CpuCoreCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(DbServerPatchingDetails)) + { + writer.WritePropertyName("dbServerPatchingDetails"u8); + writer.WriteObjectValue(DbServerPatchingDetails, options); + } + if (options.Format != "W" && Optional.IsDefined(MaxMemoryInGbs)) + { + writer.WritePropertyName("maxMemoryInGbs"u8); + writer.WriteNumberValue(MaxMemoryInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(DbNodeStorageSizeInGbs)) + { + writer.WritePropertyName("dbNodeStorageSizeInGbs"u8); + writer.WriteNumberValue(DbNodeStorageSizeInGbs.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(VmClusterIds)) + { + writer.WritePropertyName("vmClusterIds"u8); + writer.WriteStartArray(); + foreach (var item in VmClusterIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(DbNodeIds)) + { + writer.WritePropertyName("dbNodeIds"u8); + writer.WriteStartArray(); + foreach (var item in DbNodeIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleDetails)) + { + writer.WritePropertyName("lifecycleDetails"u8); + writer.WriteStringValue(LifecycleDetails); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleState)) + { + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(MaxCpuCount)) + { + writer.WritePropertyName("maxCpuCount"u8); + writer.WriteNumberValue(MaxCpuCount.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AutonomousVmClusterIds)) + { + writer.WritePropertyName("autonomousVmClusterIds"u8); + writer.WriteStartArray(); + foreach (var item in AutonomousVmClusterIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AutonomousVirtualMachineIds)) + { + writer.WritePropertyName("autonomousVirtualMachineIds"u8); + writer.WriteStartArray(); + foreach (var item in AutonomousVirtualMachineIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(MaxDbNodeStorageInGbs)) + { + writer.WritePropertyName("maxDbNodeStorageInGbs"u8); + writer.WriteNumberValue(MaxDbNodeStorageInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(MemorySizeInGbs)) + { + writer.WritePropertyName("memorySizeInGbs"u8); + writer.WriteNumberValue(MemorySizeInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(Shape)) + { + writer.WritePropertyName("shape"u8); + writer.WriteStringValue(Shape); + } + if (options.Format != "W" && Optional.IsDefined(TimeCreated)) + { + writer.WritePropertyName("timeCreated"u8); + writer.WriteStringValue(TimeCreated.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ComputeModel)) + { + writer.WritePropertyName("computeModel"u8); + writer.WriteStringValue(ComputeModel.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 + } + } + } + + DbServerProperties 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(DbServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDbServerProperties(document.RootElement, options); + } + + internal static DbServerProperties DeserializeDbServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string ocid = default; + string displayName = default; + string compartmentId = default; + string exadataInfrastructureId = default; + int? cpuCoreCount = default; + DbServerPatchingDetails dbServerPatchingDetails = default; + int? maxMemoryInGbs = default; + int? dbNodeStorageSizeInGbs = default; + IReadOnlyList vmClusterIds = default; + IReadOnlyList dbNodeIds = default; + string lifecycleDetails = default; + DbServerProvisioningState? lifecycleState = default; + int? maxCpuCount = default; + IReadOnlyList autonomousVmClusterIds = default; + IReadOnlyList autonomousVirtualMachineIds = default; + int? maxDbNodeStorageInGbs = default; + int? memorySizeInGbs = default; + string shape = default; + DateTimeOffset? timeCreated = default; + ResourceProvisioningState? provisioningState = default; + ComputeModel? computeModel = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("compartmentId"u8)) + { + compartmentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("exadataInfrastructureId"u8)) + { + exadataInfrastructureId = property.Value.GetString(); + continue; + } + if (property.NameEquals("cpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dbServerPatchingDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbServerPatchingDetails = DbServerPatchingDetails.DeserializeDbServerPatchingDetails(property.Value, options); + continue; + } + if (property.NameEquals("maxMemoryInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxMemoryInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dbNodeStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbNodeStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("vmClusterIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + vmClusterIds = array; + continue; + } + if (property.NameEquals("dbNodeIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dbNodeIds = array; + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new DbServerProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("maxCpuCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxCpuCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("autonomousVmClusterIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + autonomousVmClusterIds = array; + continue; + } + if (property.NameEquals("autonomousVirtualMachineIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + autonomousVirtualMachineIds = array; + continue; + } + if (property.NameEquals("maxDbNodeStorageInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxDbNodeStorageInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("memorySizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memorySizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("shape"u8)) + { + shape = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new ComputeModel(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DbServerProperties( + ocid, + displayName, + compartmentId, + exadataInfrastructureId, + cpuCoreCount, + dbServerPatchingDetails, + maxMemoryInGbs, + dbNodeStorageSizeInGbs, + vmClusterIds ?? new ChangeTrackingList(), + dbNodeIds ?? new ChangeTrackingList(), + lifecycleDetails, + lifecycleState, + maxCpuCount, + autonomousVmClusterIds ?? new ChangeTrackingList(), + autonomousVirtualMachineIds ?? new ChangeTrackingList(), + maxDbNodeStorageInGbs, + memorySizeInGbs, + shape, + timeCreated, + provisioningState, + computeModel, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DbServerProperties)} does not support writing '{options.Format}' format."); + } + } + + DbServerProperties 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 DeserializeDbServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DbServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerProperties.cs new file mode 100644 index 000000000000..920cecc9a4f2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerProperties.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// DbServer resource properties. + public partial class DbServerProperties + { + /// + /// 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 DbServerProperties() + { + VmClusterIds = new ChangeTrackingList(); + DbNodeIds = new ChangeTrackingList(); + AutonomousVmClusterIds = new ChangeTrackingList(); + AutonomousVirtualMachineIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Db server name. + /// The name for the Db Server. + /// The OCID of the compartment. + /// The OCID of the Exadata infrastructure. + /// The number of CPU cores enabled on the Db server. + /// dbServerPatching details of the Db server. + /// The total memory available in GBs. + /// The allocated local node storage in GBs on the Db server. + /// The OCID of the VM Clusters associated with the Db server. + /// The OCID of the Db nodes associated with the Db server. + /// Lifecycle details of dbServer. + /// DbServer provisioning state. + /// The total number of CPU cores available. + /// The list of OCIDs of the Autonomous VM Clusters associated with the Db server. + /// The list of OCIDs of the Autonomous Virtual Machines associated with the Db server. + /// The total max dbNode storage in GBs. + /// The total memory size in GBs. + /// The shape of the Db server. The shape determines the amount of CPU, storage, and memory resources available. + /// The date and time that the Db Server was created. + /// Azure resource provisioning state. + /// The compute model of the Exadata Infrastructure. + /// Keeps track of any properties unknown to the library. + internal DbServerProperties(string ocid, string displayName, string compartmentId, string exadataInfrastructureId, int? cpuCoreCount, DbServerPatchingDetails dbServerPatchingDetails, int? maxMemoryInGbs, int? dbNodeStorageSizeInGbs, IReadOnlyList vmClusterIds, IReadOnlyList dbNodeIds, string lifecycleDetails, DbServerProvisioningState? lifecycleState, int? maxCpuCount, IReadOnlyList autonomousVmClusterIds, IReadOnlyList autonomousVirtualMachineIds, int? maxDbNodeStorageInGbs, int? memorySizeInGbs, string shape, DateTimeOffset? timeCreated, ResourceProvisioningState? provisioningState, ComputeModel? computeModel, IDictionary serializedAdditionalRawData) + { + Ocid = ocid; + DisplayName = displayName; + CompartmentId = compartmentId; + ExadataInfrastructureId = exadataInfrastructureId; + CpuCoreCount = cpuCoreCount; + DbServerPatchingDetails = dbServerPatchingDetails; + MaxMemoryInGbs = maxMemoryInGbs; + DbNodeStorageSizeInGbs = dbNodeStorageSizeInGbs; + VmClusterIds = vmClusterIds; + DbNodeIds = dbNodeIds; + LifecycleDetails = lifecycleDetails; + LifecycleState = lifecycleState; + MaxCpuCount = maxCpuCount; + AutonomousVmClusterIds = autonomousVmClusterIds; + AutonomousVirtualMachineIds = autonomousVirtualMachineIds; + MaxDbNodeStorageInGbs = maxDbNodeStorageInGbs; + MemorySizeInGbs = memorySizeInGbs; + Shape = shape; + TimeCreated = timeCreated; + ProvisioningState = provisioningState; + ComputeModel = computeModel; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Db server name. + public string Ocid { get; } + /// The name for the Db Server. + public string DisplayName { get; } + /// The OCID of the compartment. + public string CompartmentId { get; } + /// The OCID of the Exadata infrastructure. + public string ExadataInfrastructureId { get; } + /// The number of CPU cores enabled on the Db server. + public int? CpuCoreCount { get; } + /// dbServerPatching details of the Db server. + public DbServerPatchingDetails DbServerPatchingDetails { get; } + /// The total memory available in GBs. + public int? MaxMemoryInGbs { get; } + /// The allocated local node storage in GBs on the Db server. + public int? DbNodeStorageSizeInGbs { get; } + /// The OCID of the VM Clusters associated with the Db server. + public IReadOnlyList VmClusterIds { get; } + /// The OCID of the Db nodes associated with the Db server. + public IReadOnlyList DbNodeIds { get; } + /// Lifecycle details of dbServer. + public string LifecycleDetails { get; } + /// DbServer provisioning state. + public DbServerProvisioningState? LifecycleState { get; } + /// The total number of CPU cores available. + public int? MaxCpuCount { get; } + /// The list of OCIDs of the Autonomous VM Clusters associated with the Db server. + public IReadOnlyList AutonomousVmClusterIds { get; } + /// The list of OCIDs of the Autonomous Virtual Machines associated with the Db server. + public IReadOnlyList AutonomousVirtualMachineIds { get; } + /// The total max dbNode storage in GBs. + public int? MaxDbNodeStorageInGbs { get; } + /// The total memory size in GBs. + public int? MemorySizeInGbs { get; } + /// The shape of the Db server. The shape determines the amount of CPU, storage, and memory resources available. + public string Shape { get; } + /// The date and time that the Db Server was created. + public DateTimeOffset? TimeCreated { get; } + /// Azure resource provisioning state. + public ResourceProvisioningState? ProvisioningState { get; } + /// The compute model of the Exadata Infrastructure. + public ComputeModel? ComputeModel { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerProvisioningState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerProvisioningState.cs new file mode 100644 index 000000000000..f1b9f10791e9 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbServerProvisioningState.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.OracleDatabase.Models +{ + /// DbServerProvisioningState enum. + public readonly partial struct DbServerProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DbServerProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreatingValue = "Creating"; + private const string AvailableValue = "Available"; + private const string UnavailableValue = "Unavailable"; + private const string DeletingValue = "Deleting"; + private const string DeletedValue = "Deleted"; + private const string MaintenanceInProgressValue = "MaintenanceInProgress"; + + /// Indicates that resource in Creating state. + public static DbServerProvisioningState Creating { get; } = new DbServerProvisioningState(CreatingValue); + /// Indicates that resource in Available state. + public static DbServerProvisioningState Available { get; } = new DbServerProvisioningState(AvailableValue); + /// Indicates that resource in Unavailable state. + public static DbServerProvisioningState Unavailable { get; } = new DbServerProvisioningState(UnavailableValue); + /// Indicates that resource in Deleting state. + public static DbServerProvisioningState Deleting { get; } = new DbServerProvisioningState(DeletingValue); + /// Indicates that resource in Deleted state. + public static DbServerProvisioningState Deleted { get; } = new DbServerProvisioningState(DeletedValue); + /// Indicates that resource maintenance in progress state. + public static DbServerProvisioningState MaintenanceInProgress { get; } = new DbServerProvisioningState(MaintenanceInProgressValue); + /// Determines if two values are the same. + public static bool operator ==(DbServerProvisioningState left, DbServerProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DbServerProvisioningState left, DbServerProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DbServerProvisioningState(string value) => new DbServerProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DbServerProvisioningState other && Equals(other); + /// + public bool Equals(DbServerProvisioningState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeListResult.Serialization.cs new file mode 100644 index 000000000000..77baf8c40300 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeListResult.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.OracleDatabase.Models +{ + internal partial class DbSystemShapeListResult : 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(DbSystemShapeListResult)} 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 + } + } + } + + DbSystemShapeListResult 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(DbSystemShapeListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDbSystemShapeListResult(document.RootElement, options); + } + + internal static DbSystemShapeListResult DeserializeDbSystemShapeListResult(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(DbSystemShapeData.DeserializeDbSystemShapeData(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 DbSystemShapeListResult(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); + default: + throw new FormatException($"The model {nameof(DbSystemShapeListResult)} does not support writing '{options.Format}' format."); + } + } + + DbSystemShapeListResult 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 DeserializeDbSystemShapeListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DbSystemShapeListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeListResult.cs new file mode 100644 index 000000000000..ad994bcaf78b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeListResult.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.OracleDatabase.Models +{ + /// The response of a DbSystemShape list operation. + internal partial class DbSystemShapeListResult + { + /// + /// 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 DbSystemShape items on this page. + /// is null. + internal DbSystemShapeListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The DbSystemShape items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DbSystemShapeListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DbSystemShapeListResult() + { + } + + /// The DbSystemShape items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeProperties.Serialization.cs new file mode 100644 index 000000000000..ee01253b48db --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeProperties.Serialization.cs @@ -0,0 +1,481 @@ +// 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.OracleDatabase.Models +{ + public partial class DbSystemShapeProperties : 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(DbSystemShapeProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ShapeFamily)) + { + writer.WritePropertyName("shapeFamily"u8); + writer.WriteStringValue(ShapeFamily); + } + writer.WritePropertyName("shapeName"u8); + writer.WriteStringValue(ShapeName); + writer.WritePropertyName("availableCoreCount"u8); + writer.WriteNumberValue(AvailableCoreCount); + if (Optional.IsDefined(MinimumCoreCount)) + { + writer.WritePropertyName("minimumCoreCount"u8); + writer.WriteNumberValue(MinimumCoreCount.Value); + } + if (Optional.IsDefined(RuntimeMinimumCoreCount)) + { + writer.WritePropertyName("runtimeMinimumCoreCount"u8); + writer.WriteNumberValue(RuntimeMinimumCoreCount.Value); + } + if (Optional.IsDefined(CoreCountIncrement)) + { + writer.WritePropertyName("coreCountIncrement"u8); + writer.WriteNumberValue(CoreCountIncrement.Value); + } + if (Optional.IsDefined(MinStorageCount)) + { + writer.WritePropertyName("minStorageCount"u8); + writer.WriteNumberValue(MinStorageCount.Value); + } + if (Optional.IsDefined(MaxStorageCount)) + { + writer.WritePropertyName("maxStorageCount"u8); + writer.WriteNumberValue(MaxStorageCount.Value); + } + if (Optional.IsDefined(AvailableDataStoragePerServerInTbs)) + { + writer.WritePropertyName("availableDataStoragePerServerInTbs"u8); + writer.WriteNumberValue(AvailableDataStoragePerServerInTbs.Value); + } + if (Optional.IsDefined(AvailableMemoryPerNodeInGbs)) + { + writer.WritePropertyName("availableMemoryPerNodeInGbs"u8); + writer.WriteNumberValue(AvailableMemoryPerNodeInGbs.Value); + } + if (Optional.IsDefined(AvailableDbNodePerNodeInGbs)) + { + writer.WritePropertyName("availableDbNodePerNodeInGbs"u8); + writer.WriteNumberValue(AvailableDbNodePerNodeInGbs.Value); + } + if (Optional.IsDefined(MinCoreCountPerNode)) + { + writer.WritePropertyName("minCoreCountPerNode"u8); + writer.WriteNumberValue(MinCoreCountPerNode.Value); + } + if (Optional.IsDefined(AvailableMemoryInGbs)) + { + writer.WritePropertyName("availableMemoryInGbs"u8); + writer.WriteNumberValue(AvailableMemoryInGbs.Value); + } + if (Optional.IsDefined(MinMemoryPerNodeInGbs)) + { + writer.WritePropertyName("minMemoryPerNodeInGbs"u8); + writer.WriteNumberValue(MinMemoryPerNodeInGbs.Value); + } + if (Optional.IsDefined(AvailableDbNodeStorageInGbs)) + { + writer.WritePropertyName("availableDbNodeStorageInGbs"u8); + writer.WriteNumberValue(AvailableDbNodeStorageInGbs.Value); + } + if (Optional.IsDefined(MinDbNodeStoragePerNodeInGbs)) + { + writer.WritePropertyName("minDbNodeStoragePerNodeInGbs"u8); + writer.WriteNumberValue(MinDbNodeStoragePerNodeInGbs.Value); + } + if (Optional.IsDefined(AvailableDataStorageInTbs)) + { + writer.WritePropertyName("availableDataStorageInTbs"u8); + writer.WriteNumberValue(AvailableDataStorageInTbs.Value); + } + if (Optional.IsDefined(MinDataStorageInTbs)) + { + writer.WritePropertyName("minDataStorageInTbs"u8); + writer.WriteNumberValue(MinDataStorageInTbs.Value); + } + if (Optional.IsDefined(MinimumNodeCount)) + { + writer.WritePropertyName("minimumNodeCount"u8); + writer.WriteNumberValue(MinimumNodeCount.Value); + } + if (Optional.IsDefined(MaximumNodeCount)) + { + writer.WritePropertyName("maximumNodeCount"u8); + writer.WriteNumberValue(MaximumNodeCount.Value); + } + if (Optional.IsDefined(AvailableCoreCountPerNode)) + { + writer.WritePropertyName("availableCoreCountPerNode"u8); + writer.WriteNumberValue(AvailableCoreCountPerNode.Value); + } + if (Optional.IsDefined(ComputeModel)) + { + writer.WritePropertyName("computeModel"u8); + writer.WriteStringValue(ComputeModel.Value.ToString()); + } + if (Optional.IsDefined(AreServerTypesSupported)) + { + writer.WritePropertyName("areServerTypesSupported"u8); + writer.WriteBooleanValue(AreServerTypesSupported.Value); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + 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 + } + } + } + + DbSystemShapeProperties 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(DbSystemShapeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDbSystemShapeProperties(document.RootElement, options); + } + + internal static DbSystemShapeProperties DeserializeDbSystemShapeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string shapeFamily = default; + string shapeName = default; + int availableCoreCount = default; + int? minimumCoreCount = default; + int? runtimeMinimumCoreCount = default; + int? coreCountIncrement = default; + int? minStorageCount = default; + int? maxStorageCount = default; + double? availableDataStoragePerServerInTbs = default; + int? availableMemoryPerNodeInGbs = default; + int? availableDbNodePerNodeInGbs = default; + int? minCoreCountPerNode = default; + int? availableMemoryInGbs = default; + int? minMemoryPerNodeInGbs = default; + int? availableDbNodeStorageInGbs = default; + int? minDbNodeStoragePerNodeInGbs = default; + int? availableDataStorageInTbs = default; + int? minDataStorageInTbs = default; + int? minimumNodeCount = default; + int? maximumNodeCount = default; + int? availableCoreCountPerNode = default; + ComputeModel? computeModel = default; + bool? areServerTypesSupported = default; + string displayName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("shapeFamily"u8)) + { + shapeFamily = property.Value.GetString(); + continue; + } + if (property.NameEquals("shapeName"u8)) + { + shapeName = property.Value.GetString(); + continue; + } + if (property.NameEquals("availableCoreCount"u8)) + { + availableCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("minimumCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minimumCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("runtimeMinimumCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + runtimeMinimumCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("coreCountIncrement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + coreCountIncrement = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("minStorageCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minStorageCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxStorageCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxStorageCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("availableDataStoragePerServerInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableDataStoragePerServerInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("availableMemoryPerNodeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableMemoryPerNodeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("availableDbNodePerNodeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableDbNodePerNodeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("minCoreCountPerNode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minCoreCountPerNode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("availableMemoryInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableMemoryInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("minMemoryPerNodeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minMemoryPerNodeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("availableDbNodeStorageInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableDbNodeStorageInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("minDbNodeStoragePerNodeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minDbNodeStoragePerNodeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("availableDataStorageInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableDataStorageInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("minDataStorageInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minDataStorageInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("minimumNodeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minimumNodeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maximumNodeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maximumNodeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("availableCoreCountPerNode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableCoreCountPerNode = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new ComputeModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("areServerTypesSupported"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + areServerTypesSupported = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DbSystemShapeProperties( + shapeFamily, + shapeName, + availableCoreCount, + minimumCoreCount, + runtimeMinimumCoreCount, + coreCountIncrement, + minStorageCount, + maxStorageCount, + availableDataStoragePerServerInTbs, + availableMemoryPerNodeInGbs, + availableDbNodePerNodeInGbs, + minCoreCountPerNode, + availableMemoryInGbs, + minMemoryPerNodeInGbs, + availableDbNodeStorageInGbs, + minDbNodeStoragePerNodeInGbs, + availableDataStorageInTbs, + minDataStorageInTbs, + minimumNodeCount, + maximumNodeCount, + availableCoreCountPerNode, + computeModel, + areServerTypesSupported, + displayName, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DbSystemShapeProperties)} does not support writing '{options.Format}' format."); + } + } + + DbSystemShapeProperties 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 DeserializeDbSystemShapeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DbSystemShapeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeProperties.cs new file mode 100644 index 000000000000..67a314077419 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DbSystemShapeProperties.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// DbSystemShape resource model. + public partial class DbSystemShapeProperties + { + /// + /// 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 shape used for the DB system. + /// The maximum number of CPU cores that can be enabled on the DB system for this shape. + /// is null. + internal DbSystemShapeProperties(string shapeName, int availableCoreCount) + { + Argument.AssertNotNull(shapeName, nameof(shapeName)); + + ShapeName = shapeName; + AvailableCoreCount = availableCoreCount; + } + + /// Initializes a new instance of . + /// The family of the shape used for the DB system. + /// The shape used for the DB system. + /// The maximum number of CPU cores that can be enabled on the DB system for this shape. + /// The minimum number of CPU cores that can be enabled on the DB system for this shape. + /// The runtime minimum number of CPU cores that can be enabled on the DB system for this shape. + /// The discrete number by which the CPU core count for this shape can be increased or decreased. + /// The minimum number of Exadata storage servers available for the Exadata infrastructure. + /// The maximum number of Exadata storage servers available for the Exadata infrastructure. + /// The maximum data storage available per storage server for this shape. Only applicable to ExaCC Elastic shapes. + /// The maximum memory available per database node for this shape. Only applicable to ExaCC Elastic shapes. + /// The maximum Db Node storage available per database node for this shape. Only applicable to ExaCC Elastic shapes. + /// The minimum number of CPU cores that can be enabled per node for this shape. + /// The maximum memory that can be enabled for this shape. + /// The minimum memory that need be allocated per node for this shape. + /// The maximum Db Node storage that can be enabled for this shape. + /// The minimum Db Node storage that need be allocated per node for this shape. + /// The maximum DATA storage that can be enabled for this shape. + /// The minimum data storage that need be allocated for this shape. + /// The minimum number of database nodes available for this shape. + /// The maximum number of database nodes available for this shape. + /// The maximum number of CPU cores per database node that can be enabled for this shape. Only applicable to the flex Exadata shape and ExaCC Elastic shapes. + /// The compute model of the Exadata Infrastructure. + /// Indicates if the shape supports database and storage server types. + /// The display name of the shape used for the DB system. + /// Keeps track of any properties unknown to the library. + internal DbSystemShapeProperties(string shapeFamily, string shapeName, int availableCoreCount, int? minimumCoreCount, int? runtimeMinimumCoreCount, int? coreCountIncrement, int? minStorageCount, int? maxStorageCount, double? availableDataStoragePerServerInTbs, int? availableMemoryPerNodeInGbs, int? availableDbNodePerNodeInGbs, int? minCoreCountPerNode, int? availableMemoryInGbs, int? minMemoryPerNodeInGbs, int? availableDbNodeStorageInGbs, int? minDbNodeStoragePerNodeInGbs, int? availableDataStorageInTbs, int? minDataStorageInTbs, int? minimumNodeCount, int? maximumNodeCount, int? availableCoreCountPerNode, ComputeModel? computeModel, bool? areServerTypesSupported, string displayName, IDictionary serializedAdditionalRawData) + { + ShapeFamily = shapeFamily; + ShapeName = shapeName; + AvailableCoreCount = availableCoreCount; + MinimumCoreCount = minimumCoreCount; + RuntimeMinimumCoreCount = runtimeMinimumCoreCount; + CoreCountIncrement = coreCountIncrement; + MinStorageCount = minStorageCount; + MaxStorageCount = maxStorageCount; + AvailableDataStoragePerServerInTbs = availableDataStoragePerServerInTbs; + AvailableMemoryPerNodeInGbs = availableMemoryPerNodeInGbs; + AvailableDbNodePerNodeInGbs = availableDbNodePerNodeInGbs; + MinCoreCountPerNode = minCoreCountPerNode; + AvailableMemoryInGbs = availableMemoryInGbs; + MinMemoryPerNodeInGbs = minMemoryPerNodeInGbs; + AvailableDbNodeStorageInGbs = availableDbNodeStorageInGbs; + MinDbNodeStoragePerNodeInGbs = minDbNodeStoragePerNodeInGbs; + AvailableDataStorageInTbs = availableDataStorageInTbs; + MinDataStorageInTbs = minDataStorageInTbs; + MinimumNodeCount = minimumNodeCount; + MaximumNodeCount = maximumNodeCount; + AvailableCoreCountPerNode = availableCoreCountPerNode; + ComputeModel = computeModel; + AreServerTypesSupported = areServerTypesSupported; + DisplayName = displayName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DbSystemShapeProperties() + { + } + + /// The family of the shape used for the DB system. + public string ShapeFamily { get; } + /// The shape used for the DB system. + public string ShapeName { get; } + /// The maximum number of CPU cores that can be enabled on the DB system for this shape. + public int AvailableCoreCount { get; } + /// The minimum number of CPU cores that can be enabled on the DB system for this shape. + public int? MinimumCoreCount { get; } + /// The runtime minimum number of CPU cores that can be enabled on the DB system for this shape. + public int? RuntimeMinimumCoreCount { get; } + /// The discrete number by which the CPU core count for this shape can be increased or decreased. + public int? CoreCountIncrement { get; } + /// The minimum number of Exadata storage servers available for the Exadata infrastructure. + public int? MinStorageCount { get; } + /// The maximum number of Exadata storage servers available for the Exadata infrastructure. + public int? MaxStorageCount { get; } + /// The maximum data storage available per storage server for this shape. Only applicable to ExaCC Elastic shapes. + public double? AvailableDataStoragePerServerInTbs { get; } + /// The maximum memory available per database node for this shape. Only applicable to ExaCC Elastic shapes. + public int? AvailableMemoryPerNodeInGbs { get; } + /// The maximum Db Node storage available per database node for this shape. Only applicable to ExaCC Elastic shapes. + public int? AvailableDbNodePerNodeInGbs { get; } + /// The minimum number of CPU cores that can be enabled per node for this shape. + public int? MinCoreCountPerNode { get; } + /// The maximum memory that can be enabled for this shape. + public int? AvailableMemoryInGbs { get; } + /// The minimum memory that need be allocated per node for this shape. + public int? MinMemoryPerNodeInGbs { get; } + /// The maximum Db Node storage that can be enabled for this shape. + public int? AvailableDbNodeStorageInGbs { get; } + /// The minimum Db Node storage that need be allocated per node for this shape. + public int? MinDbNodeStoragePerNodeInGbs { get; } + /// The maximum DATA storage that can be enabled for this shape. + public int? AvailableDataStorageInTbs { get; } + /// The minimum data storage that need be allocated for this shape. + public int? MinDataStorageInTbs { get; } + /// The minimum number of database nodes available for this shape. + public int? MinimumNodeCount { get; } + /// The maximum number of database nodes available for this shape. + public int? MaximumNodeCount { get; } + /// The maximum number of CPU cores per database node that can be enabled for this shape. Only applicable to the flex Exadata shape and ExaCC Elastic shapes. + public int? AvailableCoreCountPerNode { get; } + /// The compute model of the Exadata Infrastructure. + public ComputeModel? ComputeModel { get; } + /// Indicates if the shape supports database and storage server types. + public bool? AreServerTypesSupported { get; } + /// The display name of the shape used for the DB system. + public string DisplayName { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.Serialization.cs new file mode 100644 index 000000000000..b24c087704af --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + public partial class DefinedFileSystemConfiguration : 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(DefinedFileSystemConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IsBackupPartition)) + { + writer.WritePropertyName("isBackupPartition"u8); + writer.WriteBooleanValue(IsBackupPartition.Value); + } + if (Optional.IsDefined(IsResizable)) + { + writer.WritePropertyName("isResizable"u8); + writer.WriteBooleanValue(IsResizable.Value); + } + if (Optional.IsDefined(MinSizeGb)) + { + writer.WritePropertyName("minSizeGb"u8); + writer.WriteNumberValue(MinSizeGb.Value); + } + if (Optional.IsDefined(MountPoint)) + { + writer.WritePropertyName("mountPoint"u8); + writer.WriteStringValue(MountPoint); + } + 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 + } + } + } + + DefinedFileSystemConfiguration 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(DefinedFileSystemConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDefinedFileSystemConfiguration(document.RootElement, options); + } + + internal static DefinedFileSystemConfiguration DeserializeDefinedFileSystemConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? isBackupPartition = default; + bool? isResizable = default; + int? minSizeGb = default; + string mountPoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("isBackupPartition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isBackupPartition = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isResizable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isResizable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("minSizeGb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minSizeGb = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("mountPoint"u8)) + { + mountPoint = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DefinedFileSystemConfiguration(isBackupPartition, isResizable, minSizeGb, mountPoint, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DefinedFileSystemConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DefinedFileSystemConfiguration 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 DeserializeDefinedFileSystemConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DefinedFileSystemConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.cs new file mode 100644 index 000000000000..a1adfc28521a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DefinedFileSystemConfiguration.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Predefined configurations for the file system. + public partial class DefinedFileSystemConfiguration + { + /// + /// 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 DefinedFileSystemConfiguration() + { + } + + /// Initializes a new instance of . + /// Checks if the data can be backed up. + /// Checks if the mount path is resizable. + /// Minimum size of mount path in Gb. + /// Mount path for the file system. + /// Keeps track of any properties unknown to the library. + internal DefinedFileSystemConfiguration(bool? isBackupPartition, bool? isResizable, int? minSizeGb, string mountPoint, IDictionary serializedAdditionalRawData) + { + IsBackupPartition = isBackupPartition; + IsResizable = isResizable; + MinSizeGb = minSizeGb; + MountPoint = mountPoint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Checks if the data can be backed up. + public bool? IsBackupPartition { get; } + /// Checks if the mount path is resizable. + public bool? IsResizable { get; } + /// Minimum size of mount path in Gb. + public int? MinSizeGb { get; } + /// Mount path for the file system. + public string MountPoint { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.Serialization.cs new file mode 100644 index 000000000000..7afb8644cd6c --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.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.OracleDatabase.Models +{ + public partial class DisasterRecoveryConfigurationDetails : 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(DisasterRecoveryConfigurationDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DisasterRecoveryType)) + { + writer.WritePropertyName("disasterRecoveryType"u8); + writer.WriteStringValue(DisasterRecoveryType.Value.ToString()); + } + if (Optional.IsDefined(TimeSnapshotStandbyEnabledTill)) + { + writer.WritePropertyName("timeSnapshotStandbyEnabledTill"u8); + writer.WriteStringValue(TimeSnapshotStandbyEnabledTill.Value, "O"); + } + if (Optional.IsDefined(IsSnapshotStandby)) + { + writer.WritePropertyName("isSnapshotStandby"u8); + writer.WriteBooleanValue(IsSnapshotStandby.Value); + } + if (Optional.IsDefined(IsReplicateAutomaticBackups)) + { + writer.WritePropertyName("isReplicateAutomaticBackups"u8); + writer.WriteBooleanValue(IsReplicateAutomaticBackups.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 + } + } + } + + DisasterRecoveryConfigurationDetails 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(DisasterRecoveryConfigurationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDisasterRecoveryConfigurationDetails(document.RootElement, options); + } + + internal static DisasterRecoveryConfigurationDetails DeserializeDisasterRecoveryConfigurationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DisasterRecoveryType? disasterRecoveryType = default; + DateTimeOffset? timeSnapshotStandbyEnabledTill = default; + bool? isSnapshotStandby = default; + bool? isReplicateAutomaticBackups = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("disasterRecoveryType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disasterRecoveryType = new DisasterRecoveryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeSnapshotStandbyEnabledTill"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeSnapshotStandbyEnabledTill = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("isSnapshotStandby"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSnapshotStandby = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isReplicateAutomaticBackups"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isReplicateAutomaticBackups = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DisasterRecoveryConfigurationDetails(disasterRecoveryType, timeSnapshotStandbyEnabledTill, isSnapshotStandby, isReplicateAutomaticBackups, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DisasterRecoveryConfigurationDetails)} does not support writing '{options.Format}' format."); + } + } + + DisasterRecoveryConfigurationDetails 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 DeserializeDisasterRecoveryConfigurationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DisasterRecoveryConfigurationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.cs new file mode 100644 index 000000000000..c018dac97a20 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryConfigurationDetails.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Configurations of a Disaster Recovery Details. + public partial class DisasterRecoveryConfigurationDetails + { + /// + /// 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 DisasterRecoveryConfigurationDetails() + { + } + + /// Initializes a new instance of . + /// Indicates the disaster recovery (DR) type of the Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// Time and date stored as an RFC 3339 formatted timestamp string. For example, 2022-01-01T12:00:00.000Z would set a limit for the snapshot standby to be converted back to a cross-region standby database. + /// Indicates if user wants to convert to a snapshot standby. For example, true would set a standby database to snapshot standby database. False would set a snapshot standby database back to regular standby database. + /// If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the backups taken on the Primary are not replicated to the Standby database. + /// Keeps track of any properties unknown to the library. + internal DisasterRecoveryConfigurationDetails(DisasterRecoveryType? disasterRecoveryType, DateTimeOffset? timeSnapshotStandbyEnabledTill, bool? isSnapshotStandby, bool? isReplicateAutomaticBackups, IDictionary serializedAdditionalRawData) + { + DisasterRecoveryType = disasterRecoveryType; + TimeSnapshotStandbyEnabledTill = timeSnapshotStandbyEnabledTill; + IsSnapshotStandby = isSnapshotStandby; + IsReplicateAutomaticBackups = isReplicateAutomaticBackups; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates the disaster recovery (DR) type of the Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + public DisasterRecoveryType? DisasterRecoveryType { get; set; } + /// Time and date stored as an RFC 3339 formatted timestamp string. For example, 2022-01-01T12:00:00.000Z would set a limit for the snapshot standby to be converted back to a cross-region standby database. + public DateTimeOffset? TimeSnapshotStandbyEnabledTill { get; set; } + /// Indicates if user wants to convert to a snapshot standby. For example, true would set a standby database to snapshot standby database. False would set a snapshot standby database back to regular standby database. + public bool? IsSnapshotStandby { get; set; } + /// If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the backups taken on the Primary are not replicated to the Standby database. + public bool? IsReplicateAutomaticBackups { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryType.cs new file mode 100644 index 000000000000..62bd74879f44 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DisasterRecoveryType.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.OracleDatabase.Models +{ + /// Disaster recovery type enum. + public readonly partial struct DisasterRecoveryType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DisasterRecoveryType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AdgValue = "Adg"; + private const string BackupBasedValue = "BackupBased"; + + /// ADG type. + public static DisasterRecoveryType Adg { get; } = new DisasterRecoveryType(AdgValue); + /// Backup based type. + public static DisasterRecoveryType BackupBased { get; } = new DisasterRecoveryType(BackupBasedValue); + /// Determines if two values are the same. + public static bool operator ==(DisasterRecoveryType left, DisasterRecoveryType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DisasterRecoveryType left, DisasterRecoveryType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DisasterRecoveryType(string value) => new DisasterRecoveryType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DisasterRecoveryType other && Equals(other); + /// + public bool Equals(DisasterRecoveryType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DiskRedundancy.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DiskRedundancy.cs new file mode 100644 index 000000000000..3accc80212a9 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DiskRedundancy.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.OracleDatabase.Models +{ + /// Disk redundancy enum. + public readonly partial struct DiskRedundancy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DiskRedundancy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HighValue = "High"; + private const string NormalValue = "Normal"; + + /// High redundancy. + public static DiskRedundancy High { get; } = new DiskRedundancy(HighValue); + /// Normal redundancy. + public static DiskRedundancy Normal { get; } = new DiskRedundancy(NormalValue); + /// Determines if two values are the same. + public static bool operator ==(DiskRedundancy left, DiskRedundancy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DiskRedundancy left, DiskRedundancy right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DiskRedundancy(string value) => new DiskRedundancy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DiskRedundancy other && Equals(other); + /// + public bool Equals(DiskRedundancy 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewListResult.Serialization.cs new file mode 100644 index 000000000000..6461e2072c87 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewListResult.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.OracleDatabase.Models +{ + internal partial class DnsPrivateViewListResult : 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(DnsPrivateViewListResult)} 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 + } + } + } + + DnsPrivateViewListResult 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(DnsPrivateViewListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsPrivateViewListResult(document.RootElement, options); + } + + internal static DnsPrivateViewListResult DeserializeDnsPrivateViewListResult(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(DnsPrivateViewData.DeserializeDnsPrivateViewData(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 DnsPrivateViewListResult(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); + default: + throw new FormatException($"The model {nameof(DnsPrivateViewListResult)} does not support writing '{options.Format}' format."); + } + } + + DnsPrivateViewListResult 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 DeserializeDnsPrivateViewListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsPrivateViewListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewListResult.cs new file mode 100644 index 000000000000..cf4a764b5805 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewListResult.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.OracleDatabase.Models +{ + /// The response of a DnsPrivateView list operation. + internal partial class DnsPrivateViewListResult + { + /// + /// 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 DnsPrivateView items on this page. + /// is null. + internal DnsPrivateViewListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The DnsPrivateView items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DnsPrivateViewListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DnsPrivateViewListResult() + { + } + + /// The DnsPrivateView items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewProperties.Serialization.cs new file mode 100644 index 000000000000..3b951e86cfd4 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewProperties.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.OracleDatabase.Models +{ + public partial class DnsPrivateViewProperties : 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(DnsPrivateViewProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + writer.WritePropertyName("isProtected"u8); + writer.WriteBooleanValue(IsProtected); + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.ToString()); + writer.WritePropertyName("self"u8); + writer.WriteStringValue(Self); + writer.WritePropertyName("timeCreated"u8); + writer.WriteStringValue(TimeCreated, "O"); + writer.WritePropertyName("timeUpdated"u8); + writer.WriteStringValue(TimeUpdated, "O"); + 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 + } + } + } + + DnsPrivateViewProperties 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(DnsPrivateViewProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsPrivateViewProperties(document.RootElement, options); + } + + internal static DnsPrivateViewProperties DeserializeDnsPrivateViewProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string ocid = default; + string displayName = default; + bool isProtected = default; + DnsPrivateViewsLifecycleState lifecycleState = default; + string self = default; + DateTimeOffset timeCreated = default; + DateTimeOffset timeUpdated = default; + ResourceProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isProtected"u8)) + { + isProtected = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + lifecycleState = new DnsPrivateViewsLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("self"u8)) + { + self = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeUpdated"u8)) + { + timeUpdated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ResourceProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DnsPrivateViewProperties( + ocid, + displayName, + isProtected, + lifecycleState, + self, + timeCreated, + timeUpdated, + 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); + default: + throw new FormatException($"The model {nameof(DnsPrivateViewProperties)} does not support writing '{options.Format}' format."); + } + } + + DnsPrivateViewProperties 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 DeserializeDnsPrivateViewProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsPrivateViewProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewProperties.cs new file mode 100644 index 000000000000..b7ec5205e39e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewProperties.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Views resource model. + public partial class DnsPrivateViewProperties + { + /// + /// 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 OCID of the view. + /// The display name of the view resource. + /// A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. + /// Views lifecycleState. + /// The canonical absolute URL of the resource. + /// views timeCreated. + /// views timeCreated. + /// , or is null. + internal DnsPrivateViewProperties(string ocid, string displayName, bool isProtected, DnsPrivateViewsLifecycleState lifecycleState, string self, DateTimeOffset timeCreated, DateTimeOffset timeUpdated) + { + Argument.AssertNotNull(ocid, nameof(ocid)); + Argument.AssertNotNull(displayName, nameof(displayName)); + Argument.AssertNotNull(self, nameof(self)); + + Ocid = ocid; + DisplayName = displayName; + IsProtected = isProtected; + LifecycleState = lifecycleState; + Self = self; + TimeCreated = timeCreated; + TimeUpdated = timeUpdated; + } + + /// Initializes a new instance of . + /// The OCID of the view. + /// The display name of the view resource. + /// A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. + /// Views lifecycleState. + /// The canonical absolute URL of the resource. + /// views timeCreated. + /// views timeCreated. + /// Azure resource provisioning state. + /// Keeps track of any properties unknown to the library. + internal DnsPrivateViewProperties(string ocid, string displayName, bool isProtected, DnsPrivateViewsLifecycleState lifecycleState, string self, DateTimeOffset timeCreated, DateTimeOffset timeUpdated, ResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Ocid = ocid; + DisplayName = displayName; + IsProtected = isProtected; + LifecycleState = lifecycleState; + Self = self; + TimeCreated = timeCreated; + TimeUpdated = timeUpdated; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DnsPrivateViewProperties() + { + } + + /// The OCID of the view. + public string Ocid { get; } + /// The display name of the view resource. + public string DisplayName { get; } + /// A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. + public bool IsProtected { get; } + /// Views lifecycleState. + public DnsPrivateViewsLifecycleState LifecycleState { get; } + /// The canonical absolute URL of the resource. + public string Self { get; } + /// views timeCreated. + public DateTimeOffset TimeCreated { get; } + /// views timeCreated. + public DateTimeOffset TimeUpdated { get; } + /// Azure resource provisioning state. + public ResourceProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewsLifecycleState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewsLifecycleState.cs new file mode 100644 index 000000000000..e77805dc5bc5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateViewsLifecycleState.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.OracleDatabase.Models +{ + /// DNS Private Views lifecycle state enum. + public readonly partial struct DnsPrivateViewsLifecycleState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DnsPrivateViewsLifecycleState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "Active"; + private const string DeletedValue = "Deleted"; + private const string DeletingValue = "Deleting"; + private const string UpdatingValue = "Updating"; + + /// DNS Private View is active. + public static DnsPrivateViewsLifecycleState Active { get; } = new DnsPrivateViewsLifecycleState(ActiveValue); + /// DNS Private View is deleted. + public static DnsPrivateViewsLifecycleState Deleted { get; } = new DnsPrivateViewsLifecycleState(DeletedValue); + /// DNS Private View is deleting. + public static DnsPrivateViewsLifecycleState Deleting { get; } = new DnsPrivateViewsLifecycleState(DeletingValue); + /// DNS Private View is updating. + public static DnsPrivateViewsLifecycleState Updating { get; } = new DnsPrivateViewsLifecycleState(UpdatingValue); + /// Determines if two values are the same. + public static bool operator ==(DnsPrivateViewsLifecycleState left, DnsPrivateViewsLifecycleState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DnsPrivateViewsLifecycleState left, DnsPrivateViewsLifecycleState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DnsPrivateViewsLifecycleState(string value) => new DnsPrivateViewsLifecycleState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DnsPrivateViewsLifecycleState other && Equals(other); + /// + public bool Equals(DnsPrivateViewsLifecycleState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneListResult.Serialization.cs new file mode 100644 index 000000000000..1912ce22c6e1 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneListResult.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.OracleDatabase.Models +{ + internal partial class DnsPrivateZoneListResult : 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(DnsPrivateZoneListResult)} 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 + } + } + } + + DnsPrivateZoneListResult 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(DnsPrivateZoneListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsPrivateZoneListResult(document.RootElement, options); + } + + internal static DnsPrivateZoneListResult DeserializeDnsPrivateZoneListResult(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(DnsPrivateZoneData.DeserializeDnsPrivateZoneData(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 DnsPrivateZoneListResult(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); + default: + throw new FormatException($"The model {nameof(DnsPrivateZoneListResult)} does not support writing '{options.Format}' format."); + } + } + + DnsPrivateZoneListResult 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 DeserializeDnsPrivateZoneListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsPrivateZoneListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneListResult.cs new file mode 100644 index 000000000000..8036ede88683 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneListResult.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.OracleDatabase.Models +{ + /// The response of a DnsPrivateZone list operation. + internal partial class DnsPrivateZoneListResult + { + /// + /// 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 DnsPrivateZone items on this page. + /// is null. + internal DnsPrivateZoneListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The DnsPrivateZone items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal DnsPrivateZoneListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DnsPrivateZoneListResult() + { + } + + /// The DnsPrivateZone items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneProperties.Serialization.cs new file mode 100644 index 000000000000..75e860acc0ed --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneProperties.Serialization.cs @@ -0,0 +1,219 @@ +// 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.OracleDatabase.Models +{ + public partial class DnsPrivateZoneProperties : 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(DnsPrivateZoneProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + writer.WritePropertyName("isProtected"u8); + writer.WriteBooleanValue(IsProtected); + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.ToString()); + writer.WritePropertyName("self"u8); + writer.WriteStringValue(Self); + writer.WritePropertyName("serial"u8); + writer.WriteNumberValue(Serial); + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + if (Optional.IsDefined(ViewId)) + { + writer.WritePropertyName("viewId"u8); + writer.WriteStringValue(ViewId); + } + writer.WritePropertyName("zoneType"u8); + writer.WriteStringValue(ZoneType.ToString()); + writer.WritePropertyName("timeCreated"u8); + writer.WriteStringValue(TimeCreated, "O"); + 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 + } + } + } + + DnsPrivateZoneProperties 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(DnsPrivateZoneProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDnsPrivateZoneProperties(document.RootElement, options); + } + + internal static DnsPrivateZoneProperties DeserializeDnsPrivateZoneProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string ocid = default; + bool isProtected = default; + DnsPrivateZonesLifecycleState lifecycleState = default; + string self = default; + int serial = default; + string version = default; + string viewId = default; + ZoneType zoneType = default; + DateTimeOffset timeCreated = default; + ResourceProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("isProtected"u8)) + { + isProtected = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + lifecycleState = new DnsPrivateZonesLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("self"u8)) + { + self = property.Value.GetString(); + continue; + } + if (property.NameEquals("serial"u8)) + { + serial = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("viewId"u8)) + { + viewId = property.Value.GetString(); + continue; + } + if (property.NameEquals("zoneType"u8)) + { + zoneType = new ZoneType(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ResourceProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DnsPrivateZoneProperties( + ocid, + isProtected, + lifecycleState, + self, + serial, + version, + viewId, + zoneType, + timeCreated, + 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); + default: + throw new FormatException($"The model {nameof(DnsPrivateZoneProperties)} does not support writing '{options.Format}' format."); + } + } + + DnsPrivateZoneProperties 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 DeserializeDnsPrivateZoneProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DnsPrivateZoneProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneProperties.cs new file mode 100644 index 000000000000..339772cb70ce --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZoneProperties.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Zones resource model. + public partial class DnsPrivateZoneProperties + { + /// + /// 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 OCID of the Zone. + /// A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. + /// Zones lifecycleState. + /// The canonical absolute URL of the resource. + /// The current serial of the zone. As seen in the zone's SOA record. + /// Version is the never-repeating, totally-orderable, version of the zone, from which the serial field of the zone's SOA record is derived. + /// The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only supported for GLOBAL zones. + /// Zones timeCreated. + /// , or is null. + internal DnsPrivateZoneProperties(string ocid, bool isProtected, DnsPrivateZonesLifecycleState lifecycleState, string self, int serial, string version, ZoneType zoneType, DateTimeOffset timeCreated) + { + Argument.AssertNotNull(ocid, nameof(ocid)); + Argument.AssertNotNull(self, nameof(self)); + Argument.AssertNotNull(version, nameof(version)); + + Ocid = ocid; + IsProtected = isProtected; + LifecycleState = lifecycleState; + Self = self; + Serial = serial; + Version = version; + ZoneType = zoneType; + TimeCreated = timeCreated; + } + + /// Initializes a new instance of . + /// The OCID of the Zone. + /// A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. + /// Zones lifecycleState. + /// The canonical absolute URL of the resource. + /// The current serial of the zone. As seen in the zone's SOA record. + /// Version is the never-repeating, totally-orderable, version of the zone, from which the serial field of the zone's SOA record is derived. + /// The OCID of the private view containing the zone. This value will be null for zones in the global DNS, which are publicly resolvable and not part of a private view. + /// The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only supported for GLOBAL zones. + /// Zones timeCreated. + /// Azure resource provisioning state. + /// Keeps track of any properties unknown to the library. + internal DnsPrivateZoneProperties(string ocid, bool isProtected, DnsPrivateZonesLifecycleState lifecycleState, string self, int serial, string version, string viewId, ZoneType zoneType, DateTimeOffset timeCreated, ResourceProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Ocid = ocid; + IsProtected = isProtected; + LifecycleState = lifecycleState; + Self = self; + Serial = serial; + Version = version; + ViewId = viewId; + ZoneType = zoneType; + TimeCreated = timeCreated; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DnsPrivateZoneProperties() + { + } + + /// The OCID of the Zone. + public string Ocid { get; } + /// A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed. + public bool IsProtected { get; } + /// Zones lifecycleState. + public DnsPrivateZonesLifecycleState LifecycleState { get; } + /// The canonical absolute URL of the resource. + public string Self { get; } + /// The current serial of the zone. As seen in the zone's SOA record. + public int Serial { get; } + /// Version is the never-repeating, totally-orderable, version of the zone, from which the serial field of the zone's SOA record is derived. + public string Version { get; } + /// The OCID of the private view containing the zone. This value will be null for zones in the global DNS, which are publicly resolvable and not part of a private view. + public string ViewId { get; } + /// The type of the zone. Must be either PRIMARY or SECONDARY. SECONDARY is only supported for GLOBAL zones. + public ZoneType ZoneType { get; } + /// Zones timeCreated. + public DateTimeOffset TimeCreated { get; } + /// Azure resource provisioning state. + public ResourceProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZonesLifecycleState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZonesLifecycleState.cs new file mode 100644 index 000000000000..278c8841d282 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/DnsPrivateZonesLifecycleState.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// DNS Private Zones lifecycle state enum. + public readonly partial struct DnsPrivateZonesLifecycleState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DnsPrivateZonesLifecycleState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "Active"; + private const string CreatingValue = "Creating"; + private const string DeletedValue = "Deleted"; + private const string DeletingValue = "Deleting"; + private const string UpdatingValue = "Updating"; + + /// DNS Private Zones is active. + public static DnsPrivateZonesLifecycleState Active { get; } = new DnsPrivateZonesLifecycleState(ActiveValue); + /// DNS Private Zones is creating. + public static DnsPrivateZonesLifecycleState Creating { get; } = new DnsPrivateZonesLifecycleState(CreatingValue); + /// DNS Private Zones is deleted. + public static DnsPrivateZonesLifecycleState Deleted { get; } = new DnsPrivateZonesLifecycleState(DeletedValue); + /// DNS Private Zones is deleting. + public static DnsPrivateZonesLifecycleState Deleting { get; } = new DnsPrivateZonesLifecycleState(DeletingValue); + /// DNS Private Zones is updating. + public static DnsPrivateZonesLifecycleState Updating { get; } = new DnsPrivateZonesLifecycleState(UpdatingValue); + /// Determines if two values are the same. + public static bool operator ==(DnsPrivateZonesLifecycleState left, DnsPrivateZonesLifecycleState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DnsPrivateZonesLifecycleState left, DnsPrivateZonesLifecycleState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DnsPrivateZonesLifecycleState(string value) => new DnsPrivateZonesLifecycleState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DnsPrivateZonesLifecycleState other && Equals(other); + /// + public bool Equals(DnsPrivateZonesLifecycleState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/EstimatedPatchingTime.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/EstimatedPatchingTime.Serialization.cs new file mode 100644 index 000000000000..125ffb32b7f7 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/EstimatedPatchingTime.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.OracleDatabase.Models +{ + public partial class EstimatedPatchingTime : 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(EstimatedPatchingTime)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(EstimatedDbServerPatchingTime)) + { + writer.WritePropertyName("estimatedDbServerPatchingTime"u8); + writer.WriteNumberValue(EstimatedDbServerPatchingTime.Value); + } + if (options.Format != "W" && Optional.IsDefined(EstimatedNetworkSwitchesPatchingTime)) + { + writer.WritePropertyName("estimatedNetworkSwitchesPatchingTime"u8); + writer.WriteNumberValue(EstimatedNetworkSwitchesPatchingTime.Value); + } + if (options.Format != "W" && Optional.IsDefined(EstimatedStorageServerPatchingTime)) + { + writer.WritePropertyName("estimatedStorageServerPatchingTime"u8); + writer.WriteNumberValue(EstimatedStorageServerPatchingTime.Value); + } + if (options.Format != "W" && Optional.IsDefined(TotalEstimatedPatchingTime)) + { + writer.WritePropertyName("totalEstimatedPatchingTime"u8); + writer.WriteNumberValue(TotalEstimatedPatchingTime.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 + } + } + } + + EstimatedPatchingTime 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(EstimatedPatchingTime)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEstimatedPatchingTime(document.RootElement, options); + } + + internal static EstimatedPatchingTime DeserializeEstimatedPatchingTime(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? estimatedDbServerPatchingTime = default; + int? estimatedNetworkSwitchesPatchingTime = default; + int? estimatedStorageServerPatchingTime = default; + int? totalEstimatedPatchingTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("estimatedDbServerPatchingTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + estimatedDbServerPatchingTime = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("estimatedNetworkSwitchesPatchingTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + estimatedNetworkSwitchesPatchingTime = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("estimatedStorageServerPatchingTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + estimatedStorageServerPatchingTime = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("totalEstimatedPatchingTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalEstimatedPatchingTime = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EstimatedPatchingTime(estimatedDbServerPatchingTime, estimatedNetworkSwitchesPatchingTime, estimatedStorageServerPatchingTime, totalEstimatedPatchingTime, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EstimatedPatchingTime)} does not support writing '{options.Format}' format."); + } + } + + EstimatedPatchingTime 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 DeserializeEstimatedPatchingTime(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EstimatedPatchingTime)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/EstimatedPatchingTime.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/EstimatedPatchingTime.cs new file mode 100644 index 000000000000..2d90672508c1 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/EstimatedPatchingTime.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// The estimated total time required in minutes for all patching operations (database server, storage server, and network switch patching). + public partial class EstimatedPatchingTime + { + /// + /// 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 EstimatedPatchingTime() + { + } + + /// Initializes a new instance of . + /// The estimated time required in minutes for database server patching. + /// The estimated time required in minutes for network switch patching. + /// The estimated time required in minutes for storage server patching. + /// The estimated total time required in minutes for all patching operations. + /// Keeps track of any properties unknown to the library. + internal EstimatedPatchingTime(int? estimatedDbServerPatchingTime, int? estimatedNetworkSwitchesPatchingTime, int? estimatedStorageServerPatchingTime, int? totalEstimatedPatchingTime, IDictionary serializedAdditionalRawData) + { + EstimatedDbServerPatchingTime = estimatedDbServerPatchingTime; + EstimatedNetworkSwitchesPatchingTime = estimatedNetworkSwitchesPatchingTime; + EstimatedStorageServerPatchingTime = estimatedStorageServerPatchingTime; + TotalEstimatedPatchingTime = totalEstimatedPatchingTime; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The estimated time required in minutes for database server patching. + public int? EstimatedDbServerPatchingTime { get; } + /// The estimated time required in minutes for network switch patching. + public int? EstimatedNetworkSwitchesPatchingTime { get; } + /// The estimated time required in minutes for storage server patching. + public int? EstimatedStorageServerPatchingTime { get; } + /// The estimated total time required in minutes for all patching operations. + public int? TotalEstimatedPatchingTime { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadataIormConfig.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadataIormConfig.Serialization.cs new file mode 100644 index 000000000000..07ffc66d4730 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadataIormConfig.Serialization.cs @@ -0,0 +1,184 @@ +// 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.OracleDatabase.Models +{ + public partial class ExadataIormConfig : 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(ExadataIormConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(DbPlans)) + { + writer.WritePropertyName("dbPlans"u8); + writer.WriteStartArray(); + foreach (var item in DbPlans) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(LifecycleDetails)) + { + writer.WritePropertyName("lifecycleDetails"u8); + writer.WriteStringValue(LifecycleDetails); + } + if (Optional.IsDefined(LifecycleState)) + { + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.Value.ToString()); + } + if (Optional.IsDefined(Objective)) + { + writer.WritePropertyName("objective"u8); + writer.WriteStringValue(Objective.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 + } + } + } + + ExadataIormConfig 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(ExadataIormConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExadataIormConfig(document.RootElement, options); + } + + internal static ExadataIormConfig DeserializeExadataIormConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList dbPlans = default; + string lifecycleDetails = default; + IormLifecycleState? lifecycleState = default; + Objective? objective = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dbPlans"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DbIormConfig.DeserializeDbIormConfig(item, options)); + } + dbPlans = array; + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new IormLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("objective"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + objective = new Objective(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExadataIormConfig(dbPlans ?? new ChangeTrackingList(), lifecycleDetails, lifecycleState, objective, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExadataIormConfig)} does not support writing '{options.Format}' format."); + } + } + + ExadataIormConfig 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 DeserializeExadataIormConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExadataIormConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadataIormConfig.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadataIormConfig.cs new file mode 100644 index 000000000000..7589ab690c9e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadataIormConfig.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// ExadataIormConfig for cloud vm cluster. + public partial class ExadataIormConfig + { + /// + /// 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 ExadataIormConfig() + { + DbPlans = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// An array of IORM settings for all the database in the Exadata DB system. + /// Additional information about the current lifecycleState. + /// The current state of IORM configuration for the Exadata DB system. + /// The current value for the IORM objective. The default is AUTO. + /// Keeps track of any properties unknown to the library. + internal ExadataIormConfig(IReadOnlyList dbPlans, string lifecycleDetails, IormLifecycleState? lifecycleState, Objective? objective, IDictionary serializedAdditionalRawData) + { + DbPlans = dbPlans; + LifecycleDetails = lifecycleDetails; + LifecycleState = lifecycleState; + Objective = objective; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// An array of IORM settings for all the database in the Exadata DB system. + public IReadOnlyList DbPlans { get; } + /// Additional information about the current lifecycleState. + public string LifecycleDetails { get; } + /// The current state of IORM configuration for the Exadata DB system. + public IormLifecycleState? LifecycleState { get; } + /// The current value for the IORM objective. The default is AUTO. + public Objective? Objective { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterLifecycleState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterLifecycleState.cs new file mode 100644 index 000000000000..e8ea2cb028ed --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterLifecycleState.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.OracleDatabase.Models +{ + /// Exadata VM cluster on Exascale Infrastructure lifecycle state enum. + public readonly partial struct ExadbVmClusterLifecycleState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ExadbVmClusterLifecycleState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProvisioningValue = "Provisioning"; + private const string AvailableValue = "Available"; + private const string UpdatingValue = "Updating"; + private const string TerminatingValue = "Terminating"; + private const string TerminatedValue = "Terminated"; + private const string MaintenanceInProgressValue = "MaintenanceInProgress"; + private const string FailedValue = "Failed"; + + /// Indicates that resource in Provisioning state. + public static ExadbVmClusterLifecycleState Provisioning { get; } = new ExadbVmClusterLifecycleState(ProvisioningValue); + /// Indicates that resource in Available state. + public static ExadbVmClusterLifecycleState Available { get; } = new ExadbVmClusterLifecycleState(AvailableValue); + /// Indicates that resource in Updating state. + public static ExadbVmClusterLifecycleState Updating { get; } = new ExadbVmClusterLifecycleState(UpdatingValue); + /// Indicates that resource in Terminating state. + public static ExadbVmClusterLifecycleState Terminating { get; } = new ExadbVmClusterLifecycleState(TerminatingValue); + /// Indicates that resource in Terminated state. + public static ExadbVmClusterLifecycleState Terminated { get; } = new ExadbVmClusterLifecycleState(TerminatedValue); + /// Indicates that resource Maintenance in progress state. + public static ExadbVmClusterLifecycleState MaintenanceInProgress { get; } = new ExadbVmClusterLifecycleState(MaintenanceInProgressValue); + /// Indicates that resource in Failed state. + public static ExadbVmClusterLifecycleState Failed { get; } = new ExadbVmClusterLifecycleState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(ExadbVmClusterLifecycleState left, ExadbVmClusterLifecycleState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ExadbVmClusterLifecycleState left, ExadbVmClusterLifecycleState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ExadbVmClusterLifecycleState(string value) => new ExadbVmClusterLifecycleState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ExadbVmClusterLifecycleState other && Equals(other); + /// + public bool Equals(ExadbVmClusterLifecycleState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.Serialization.cs new file mode 100644 index 000000000000..9a7fd7cd393d --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.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.OracleDatabase.Models +{ + internal partial class ExadbVmClusterListResult : 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(ExadbVmClusterListResult)} 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 + } + } + } + + ExadbVmClusterListResult 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(ExadbVmClusterListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExadbVmClusterListResult(document.RootElement, options); + } + + internal static ExadbVmClusterListResult DeserializeExadbVmClusterListResult(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(ExadbVmClusterData.DeserializeExadbVmClusterData(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 ExadbVmClusterListResult(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); + default: + throw new FormatException($"The model {nameof(ExadbVmClusterListResult)} does not support writing '{options.Format}' format."); + } + } + + ExadbVmClusterListResult 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 DeserializeExadbVmClusterListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExadbVmClusterListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.cs new file mode 100644 index 000000000000..0b76d8b494a5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterListResult.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.OracleDatabase.Models +{ + /// The response of a ExadbVmCluster list operation. + internal partial class ExadbVmClusterListResult + { + /// + /// 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 ExadbVmCluster items on this page. + /// is null. + internal ExadbVmClusterListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ExadbVmCluster items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ExadbVmClusterListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExadbVmClusterListResult() + { + } + + /// The ExadbVmCluster items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.Serialization.cs new file mode 100644 index 000000000000..7d4c2ebd7bd6 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.Serialization.cs @@ -0,0 +1,184 @@ +// 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.OracleDatabase.Models +{ + public partial class ExadbVmClusterPatch : 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(ExadbVmClusterPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Zones)) + { + writer.WritePropertyName("zones"u8); + writer.WriteStartArray(); + foreach (var item in Zones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + 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 (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 + } + } + } + + ExadbVmClusterPatch 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(ExadbVmClusterPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExadbVmClusterPatch(document.RootElement, options); + } + + internal static ExadbVmClusterPatch DeserializeExadbVmClusterPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList zones = default; + IDictionary tags = default; + ExadbVmClusterUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("zones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; + 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("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ExadbVmClusterUpdateProperties.DeserializeExadbVmClusterUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExadbVmClusterPatch(zones ?? new ChangeTrackingList(), 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); + default: + throw new FormatException($"The model {nameof(ExadbVmClusterPatch)} does not support writing '{options.Format}' format."); + } + } + + ExadbVmClusterPatch 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 DeserializeExadbVmClusterPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExadbVmClusterPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.cs new file mode 100644 index 000000000000..7519852ffaf6 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterPatch.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.OracleDatabase.Models +{ + /// The type used for update operations of the ExadbVmCluster. + public partial class ExadbVmClusterPatch + { + /// + /// 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 ExadbVmClusterPatch() + { + Zones = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The availability zones. + /// Resource tags. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal ExadbVmClusterPatch(IList zones, IDictionary tags, ExadbVmClusterUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Zones = zones; + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The availability zones. + public IList Zones { get; } + /// Resource tags. + public IDictionary Tags { get; } + /// The resource-specific properties for this resource. + internal ExadbVmClusterUpdateProperties Properties { get; set; } + /// The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + public int? ExadbVmClusterUpdateNodeCount + { + get => Properties is null ? default : Properties.NodeCount; + set + { + if (Properties is null) + Properties = new ExadbVmClusterUpdateProperties(); + Properties.NodeCount = value; + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.Serialization.cs new file mode 100644 index 000000000000..b49be826e241 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.Serialization.cs @@ -0,0 +1,710 @@ +// 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.OracleDatabase.Models +{ + public partial class ExadbVmClusterProperties : 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(ExadbVmClusterProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Ocid)) + { + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + } + if (Optional.IsDefined(ClusterName)) + { + writer.WritePropertyName("clusterName"u8); + writer.WriteStringValue(ClusterName); + } + if (Optional.IsDefined(BackupSubnetCidr)) + { + writer.WritePropertyName("backupSubnetCidr"u8); + writer.WriteStringValue(BackupSubnetCidr); + } + if (options.Format != "W" && Optional.IsDefined(NsgUri)) + { + writer.WritePropertyName("nsgUrl"u8); + writer.WriteStringValue(NsgUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleState)) + { + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.Value.ToString()); + } + writer.WritePropertyName("vnetId"u8); + writer.WriteStringValue(VnetId); + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + if (Optional.IsDefined(DataCollectionOptions)) + { + writer.WritePropertyName("dataCollectionOptions"u8); + writer.WriteObjectValue(DataCollectionOptions, options); + } + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + if (Optional.IsDefined(Domain)) + { + writer.WritePropertyName("domain"u8); + writer.WriteStringValue(Domain); + } + writer.WritePropertyName("enabledEcpuCount"u8); + writer.WriteNumberValue(EnabledEcpuCount); + writer.WritePropertyName("exascaleDbStorageVaultId"u8); + writer.WriteStringValue(ExascaleDbStorageVaultId); + if (Optional.IsDefined(GridImageOcid)) + { + writer.WritePropertyName("gridImageOcid"u8); + writer.WriteStringValue(GridImageOcid); + } + if (options.Format != "W" && Optional.IsDefined(GridImageType)) + { + writer.WritePropertyName("gridImageType"u8); + writer.WriteStringValue(GridImageType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(GiVersion)) + { + writer.WritePropertyName("giVersion"u8); + writer.WriteStringValue(GiVersion); + } + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + if (Optional.IsDefined(LicenseModel)) + { + writer.WritePropertyName("licenseModel"u8); + writer.WriteStringValue(LicenseModel.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(MemorySizeInGbs)) + { + writer.WritePropertyName("memorySizeInGbs"u8); + writer.WriteNumberValue(MemorySizeInGbs.Value); + } + writer.WritePropertyName("nodeCount"u8); + writer.WriteNumberValue(NodeCount); + if (Optional.IsCollectionDefined(NsgCidrs)) + { + writer.WritePropertyName("nsgCidrs"u8); + writer.WriteStartArray(); + foreach (var item in NsgCidrs) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ZoneOcid)) + { + writer.WritePropertyName("zoneOcid"u8); + writer.WriteStringValue(ZoneOcid); + } + if (Optional.IsDefined(PrivateZoneOcid)) + { + writer.WritePropertyName("privateZoneOcid"u8); + writer.WriteStringValue(PrivateZoneOcid); + } + if (Optional.IsDefined(ScanListenerPortTcp)) + { + writer.WritePropertyName("scanListenerPortTcp"u8); + writer.WriteNumberValue(ScanListenerPortTcp.Value); + } + if (Optional.IsDefined(ScanListenerPortTcpSsl)) + { + writer.WritePropertyName("scanListenerPortTcpSsl"u8); + writer.WriteNumberValue(ScanListenerPortTcpSsl.Value); + } + if (options.Format != "W" && Optional.IsDefined(ListenerPort)) + { + writer.WritePropertyName("listenerPort"u8); + writer.WriteNumberValue(ListenerPort.Value); + } + writer.WritePropertyName("shape"u8); + writer.WriteStringValue(Shape); + writer.WritePropertyName("sshPublicKeys"u8); + writer.WriteStartArray(); + foreach (var item in SshPublicKeys) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsDefined(SystemVersion)) + { + writer.WritePropertyName("systemVersion"u8); + writer.WriteStringValue(SystemVersion); + } + if (Optional.IsDefined(TimeZone)) + { + writer.WritePropertyName("timeZone"u8); + writer.WriteStringValue(TimeZone); + } + writer.WritePropertyName("totalEcpuCount"u8); + writer.WriteNumberValue(TotalEcpuCount); + writer.WritePropertyName("vmFileSystemStorage"u8); + writer.WriteObjectValue(VmFileSystemStorage, options); + if (options.Format != "W" && Optional.IsDefined(LifecycleDetails)) + { + writer.WritePropertyName("lifecycleDetails"u8); + writer.WriteStringValue(LifecycleDetails); + } + if (options.Format != "W" && Optional.IsDefined(ScanDnsName)) + { + writer.WritePropertyName("scanDnsName"u8); + writer.WriteStringValue(ScanDnsName); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ScanIPIds)) + { + writer.WritePropertyName("scanIpIds"u8); + writer.WriteStartArray(); + foreach (var item in ScanIPIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ScanDnsRecordId)) + { + writer.WritePropertyName("scanDnsRecordId"u8); + writer.WriteStringValue(ScanDnsRecordId); + } + if (options.Format != "W" && Optional.IsDefined(SnapshotFileSystemStorage)) + { + writer.WritePropertyName("snapshotFileSystemStorage"u8); + writer.WriteObjectValue(SnapshotFileSystemStorage, options); + } + if (options.Format != "W" && Optional.IsDefined(TotalFileSystemStorage)) + { + writer.WritePropertyName("totalFileSystemStorage"u8); + writer.WriteObjectValue(TotalFileSystemStorage, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(VipIds)) + { + writer.WritePropertyName("vipIds"u8); + writer.WriteStartArray(); + foreach (var item in VipIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(OciUri)) + { + writer.WritePropertyName("ociUrl"u8); + writer.WriteStringValue(OciUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(IormConfigCache)) + { + writer.WritePropertyName("iormConfigCache"u8); + writer.WriteObjectValue(IormConfigCache, options); + } + if (options.Format != "W" && Optional.IsDefined(BackupSubnetOcid)) + { + writer.WritePropertyName("backupSubnetOcid"u8); + writer.WriteStringValue(BackupSubnetOcid); + } + if (options.Format != "W" && Optional.IsDefined(SubnetOcid)) + { + writer.WritePropertyName("subnetOcid"u8); + writer.WriteStringValue(SubnetOcid); + } + 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 + } + } + } + + ExadbVmClusterProperties 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(ExadbVmClusterProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExadbVmClusterProperties(document.RootElement, options); + } + + internal static ExadbVmClusterProperties DeserializeExadbVmClusterProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string ocid = default; + string clusterName = default; + string backupSubnetCidr = default; + Uri nsgUrl = default; + AzureResourceProvisioningState? provisioningState = default; + ExadbVmClusterLifecycleState? lifecycleState = default; + ResourceIdentifier vnetId = default; + ResourceIdentifier subnetId = default; + DataCollectionOptions dataCollectionOptions = default; + string displayName = default; + string domain = default; + int enabledEcpuCount = default; + ResourceIdentifier exascaleDbStorageVaultId = default; + string gridImageOcid = default; + GridImageType? gridImageType = default; + string giVersion = default; + string hostname = default; + LicenseModel? licenseModel = default; + int? memorySizeInGbs = default; + int nodeCount = default; + IList nsgCidrs = default; + string zoneOcid = default; + string privateZoneOcid = default; + int? scanListenerPortTcp = default; + int? scanListenerPortTcpSsl = default; + int? listenerPort = default; + string shape = default; + IList sshPublicKeys = default; + string systemVersion = default; + string timeZone = default; + int totalEcpuCount = default; + ExadbVmClusterStorageDetails vmFileSystemStorage = default; + string lifecycleDetails = default; + string scanDnsName = default; + IReadOnlyList scanIPIds = default; + string scanDnsRecordId = default; + ExadbVmClusterStorageDetails snapshotFileSystemStorage = default; + ExadbVmClusterStorageDetails totalFileSystemStorage = default; + IReadOnlyList vipIds = default; + Uri ociUrl = default; + ExadataIormConfig iormConfigCache = default; + string backupSubnetOcid = default; + string subnetOcid = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("clusterName"u8)) + { + clusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("backupSubnetCidr"u8)) + { + backupSubnetCidr = property.Value.GetString(); + continue; + } + if (property.NameEquals("nsgUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nsgUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new ExadbVmClusterLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("vnetId"u8)) + { + vnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("dataCollectionOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataCollectionOptions = DataCollectionOptions.DeserializeDataCollectionOptions(property.Value, options); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("domain"u8)) + { + domain = property.Value.GetString(); + continue; + } + if (property.NameEquals("enabledEcpuCount"u8)) + { + enabledEcpuCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("exascaleDbStorageVaultId"u8)) + { + exascaleDbStorageVaultId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("gridImageOcid"u8)) + { + gridImageOcid = property.Value.GetString(); + continue; + } + if (property.NameEquals("gridImageType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gridImageType = new GridImageType(property.Value.GetString()); + continue; + } + if (property.NameEquals("giVersion"u8)) + { + giVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("licenseModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + licenseModel = new LicenseModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("memorySizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memorySizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nodeCount"u8)) + { + nodeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nsgCidrs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NsgCidr.DeserializeNsgCidr(item, options)); + } + nsgCidrs = array; + continue; + } + if (property.NameEquals("zoneOcid"u8)) + { + zoneOcid = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateZoneOcid"u8)) + { + privateZoneOcid = property.Value.GetString(); + continue; + } + if (property.NameEquals("scanListenerPortTcp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scanListenerPortTcp = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("scanListenerPortTcpSsl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scanListenerPortTcpSsl = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("listenerPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + listenerPort = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("shape"u8)) + { + shape = property.Value.GetString(); + continue; + } + if (property.NameEquals("sshPublicKeys"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sshPublicKeys = array; + continue; + } + if (property.NameEquals("systemVersion"u8)) + { + systemVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeZone"u8)) + { + timeZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("totalEcpuCount"u8)) + { + totalEcpuCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("vmFileSystemStorage"u8)) + { + vmFileSystemStorage = ExadbVmClusterStorageDetails.DeserializeExadbVmClusterStorageDetails(property.Value, options); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("scanDnsName"u8)) + { + scanDnsName = property.Value.GetString(); + continue; + } + if (property.NameEquals("scanIpIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + scanIPIds = array; + continue; + } + if (property.NameEquals("scanDnsRecordId"u8)) + { + scanDnsRecordId = property.Value.GetString(); + continue; + } + if (property.NameEquals("snapshotFileSystemStorage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + snapshotFileSystemStorage = ExadbVmClusterStorageDetails.DeserializeExadbVmClusterStorageDetails(property.Value, options); + continue; + } + if (property.NameEquals("totalFileSystemStorage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalFileSystemStorage = ExadbVmClusterStorageDetails.DeserializeExadbVmClusterStorageDetails(property.Value, options); + continue; + } + if (property.NameEquals("vipIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + vipIds = array; + continue; + } + if (property.NameEquals("ociUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ociUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("iormConfigCache"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iormConfigCache = ExadataIormConfig.DeserializeExadataIormConfig(property.Value, options); + continue; + } + if (property.NameEquals("backupSubnetOcid"u8)) + { + backupSubnetOcid = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnetOcid"u8)) + { + subnetOcid = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExadbVmClusterProperties( + ocid, + clusterName, + backupSubnetCidr, + nsgUrl, + provisioningState, + lifecycleState, + vnetId, + subnetId, + dataCollectionOptions, + displayName, + domain, + enabledEcpuCount, + exascaleDbStorageVaultId, + gridImageOcid, + gridImageType, + giVersion, + hostname, + licenseModel, + memorySizeInGbs, + nodeCount, + nsgCidrs ?? new ChangeTrackingList(), + zoneOcid, + privateZoneOcid, + scanListenerPortTcp, + scanListenerPortTcpSsl, + listenerPort, + shape, + sshPublicKeys, + systemVersion, + timeZone, + totalEcpuCount, + vmFileSystemStorage, + lifecycleDetails, + scanDnsName, + scanIPIds ?? new ChangeTrackingList(), + scanDnsRecordId, + snapshotFileSystemStorage, + totalFileSystemStorage, + vipIds ?? new ChangeTrackingList(), + ociUrl, + iormConfigCache, + backupSubnetOcid, + subnetOcid, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExadbVmClusterProperties)} does not support writing '{options.Format}' format."); + } + } + + ExadbVmClusterProperties 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 DeserializeExadbVmClusterProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExadbVmClusterProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.cs new file mode 100644 index 000000000000..a350c3a177ab --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterProperties.cs @@ -0,0 +1,297 @@ +// 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.OracleDatabase.Models +{ + /// ExadbVmCluster resource model. + public partial class ExadbVmClusterProperties + { + /// + /// 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 . + /// VNET for network connectivity. + /// Client subnet. + /// Display Name. + /// The number of ECPUs to enable for an Exadata VM cluster on Exascale Infrastructure. + /// The Azure Resource ID of the Exadata Database Storage Vault. + /// The hostname for the Exadata VM cluster on Exascale Infrastructure. + /// The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + /// The shape of the Exadata VM cluster on Exascale Infrastructure resource. + /// The public key portion of one or more key pairs used for SSH access to the Exadata VM cluster on Exascale Infrastructure. + /// The number of Total ECPUs for an Exadata VM cluster on Exascale Infrastructure. + /// Filesystem storage details. + /// , , , , , , or is null. + public ExadbVmClusterProperties(ResourceIdentifier vnetId, ResourceIdentifier subnetId, string displayName, int enabledEcpuCount, ResourceIdentifier exascaleDbStorageVaultId, string hostname, int nodeCount, string shape, IEnumerable sshPublicKeys, int totalEcpuCount, ExadbVmClusterStorageDetails vmFileSystemStorage) + { + Argument.AssertNotNull(vnetId, nameof(vnetId)); + Argument.AssertNotNull(subnetId, nameof(subnetId)); + Argument.AssertNotNull(displayName, nameof(displayName)); + Argument.AssertNotNull(exascaleDbStorageVaultId, nameof(exascaleDbStorageVaultId)); + Argument.AssertNotNull(hostname, nameof(hostname)); + Argument.AssertNotNull(shape, nameof(shape)); + Argument.AssertNotNull(sshPublicKeys, nameof(sshPublicKeys)); + Argument.AssertNotNull(vmFileSystemStorage, nameof(vmFileSystemStorage)); + + VnetId = vnetId; + SubnetId = subnetId; + DisplayName = displayName; + EnabledEcpuCount = enabledEcpuCount; + ExascaleDbStorageVaultId = exascaleDbStorageVaultId; + Hostname = hostname; + NodeCount = nodeCount; + NsgCidrs = new ChangeTrackingList(); + Shape = shape; + SshPublicKeys = sshPublicKeys.ToList(); + TotalEcpuCount = totalEcpuCount; + VmFileSystemStorage = vmFileSystemStorage; + ScanIPIds = new ChangeTrackingList(); + VipIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// ExadbVmCluster ocid. + /// The cluster name for Exadata VM cluster on Exascale Infrastructure. The cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + /// Client OCI backup subnet CIDR, default is 192.168.252.0/22. + /// HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface. + /// Exadata VM cluster on Exascale Infrastructure provisioning state. + /// CloudVmCluster lifecycle state. + /// VNET for network connectivity. + /// Client subnet. + /// Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + /// Display Name. + /// A domain name used for the Exadata VM cluster on Exascale Infrastructure. + /// The number of ECPUs to enable for an Exadata VM cluster on Exascale Infrastructure. + /// The Azure Resource ID of the Exadata Database Storage Vault. + /// Grid Setup will be done using this Grid Image OCID. Can be obtained using giMinorVersions API. + /// The type of Grid Image. + /// Oracle Grid Infrastructure (GI) software version. + /// The hostname for the Exadata VM cluster on Exascale Infrastructure. + /// The Oracle license model that applies to the Exadata VM cluster on Exascale Infrastructure. The default is LICENSE_INCLUDED. + /// The memory that you want to be allocated in GBs. Memory is calculated based on 11 GB per VM core reserved. + /// The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + /// CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster will be added by default. + /// The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with. + /// The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with. + /// The TCP Single Client Access Name (SCAN) port. The default port is 1521. + /// The TCPS Single Client Access Name (SCAN) port. The default port is 2484. + /// The port number configured for the listener on the Exadata VM cluster on Exascale Infrastructure. + /// The shape of the Exadata VM cluster on Exascale Infrastructure resource. + /// The public key portion of one or more key pairs used for SSH access to the Exadata VM cluster on Exascale Infrastructure. + /// Operating system version of the image. + /// The time zone of the Exadata VM cluster on Exascale Infrastructure. For details, see [Exadata Infrastructure Time Zones](/Content/Database/References/timezones.htm). + /// The number of Total ECPUs for an Exadata VM cluster on Exascale Infrastructure. + /// Filesystem storage details. + /// Additional information about the current lifecycle state. + /// The FQDN of the DNS record for the SCAN IP addresses that are associated with the Exadata VM cluster on Exascale Infrastructure. + /// The Single Client Access Name (SCAN) IP addresses associated with the Exadata VM cluster on Exascale Infrastructure. SCAN IP addresses are typically used for load balancing and are not assigned to any interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. **Note:** For a single-node DB system, this list is empty. + /// The OCID of the DNS record for the SCAN IP addresses that are associated with the Exadata VM cluster on Exascale Infrastructure. + /// Snapshot filesystem storage details. + /// Total file system storage details. + /// The virtual IP (VIP) addresses associated with the Exadata VM cluster on Exascale Infrastructure. The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata Cloud Service instance to enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. **Note:** For a single-node DB system, this list is empty. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// iormConfigCache details for Exadata VM cluster on Exascale Infrastructure. + /// Cluster backup subnet ocid. + /// Cluster subnet ocid. + /// Keeps track of any properties unknown to the library. + internal ExadbVmClusterProperties(string ocid, string clusterName, string backupSubnetCidr, Uri nsgUri, AzureResourceProvisioningState? provisioningState, ExadbVmClusterLifecycleState? lifecycleState, ResourceIdentifier vnetId, ResourceIdentifier subnetId, DataCollectionOptions dataCollectionOptions, string displayName, string domain, int enabledEcpuCount, ResourceIdentifier exascaleDbStorageVaultId, string gridImageOcid, GridImageType? gridImageType, string giVersion, string hostname, LicenseModel? licenseModel, int? memorySizeInGbs, int nodeCount, IList nsgCidrs, string zoneOcid, string privateZoneOcid, int? scanListenerPortTcp, int? scanListenerPortTcpSsl, int? listenerPort, string shape, IList sshPublicKeys, string systemVersion, string timeZone, int totalEcpuCount, ExadbVmClusterStorageDetails vmFileSystemStorage, string lifecycleDetails, string scanDnsName, IReadOnlyList scanIPIds, string scanDnsRecordId, ExadbVmClusterStorageDetails snapshotFileSystemStorage, ExadbVmClusterStorageDetails totalFileSystemStorage, IReadOnlyList vipIds, Uri ociUri, ExadataIormConfig iormConfigCache, string backupSubnetOcid, string subnetOcid, IDictionary serializedAdditionalRawData) + { + Ocid = ocid; + ClusterName = clusterName; + BackupSubnetCidr = backupSubnetCidr; + NsgUri = nsgUri; + ProvisioningState = provisioningState; + LifecycleState = lifecycleState; + VnetId = vnetId; + SubnetId = subnetId; + DataCollectionOptions = dataCollectionOptions; + DisplayName = displayName; + Domain = domain; + EnabledEcpuCount = enabledEcpuCount; + ExascaleDbStorageVaultId = exascaleDbStorageVaultId; + GridImageOcid = gridImageOcid; + GridImageType = gridImageType; + GiVersion = giVersion; + Hostname = hostname; + LicenseModel = licenseModel; + MemorySizeInGbs = memorySizeInGbs; + NodeCount = nodeCount; + NsgCidrs = nsgCidrs; + ZoneOcid = zoneOcid; + PrivateZoneOcid = privateZoneOcid; + ScanListenerPortTcp = scanListenerPortTcp; + ScanListenerPortTcpSsl = scanListenerPortTcpSsl; + ListenerPort = listenerPort; + Shape = shape; + SshPublicKeys = sshPublicKeys; + SystemVersion = systemVersion; + TimeZone = timeZone; + TotalEcpuCount = totalEcpuCount; + VmFileSystemStorage = vmFileSystemStorage; + LifecycleDetails = lifecycleDetails; + ScanDnsName = scanDnsName; + ScanIPIds = scanIPIds; + ScanDnsRecordId = scanDnsRecordId; + SnapshotFileSystemStorage = snapshotFileSystemStorage; + TotalFileSystemStorage = totalFileSystemStorage; + VipIds = vipIds; + OciUri = ociUri; + IormConfigCache = iormConfigCache; + BackupSubnetOcid = backupSubnetOcid; + SubnetOcid = subnetOcid; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExadbVmClusterProperties() + { + } + + /// ExadbVmCluster ocid. + public string Ocid { get; } + /// The cluster name for Exadata VM cluster on Exascale Infrastructure. The cluster name must begin with an alphabetic character, and may contain hyphens (-). Underscores (_) are not permitted. The cluster name can be no longer than 11 characters and is not case sensitive. + public string ClusterName { get; set; } + /// Client OCI backup subnet CIDR, default is 192.168.252.0/22. + public string BackupSubnetCidr { get; set; } + /// HTTPS link to OCI Network Security Group exposed to Azure Customer via the Azure Interface. + public Uri NsgUri { get; } + /// Exadata VM cluster on Exascale Infrastructure provisioning state. + public AzureResourceProvisioningState? ProvisioningState { get; } + /// CloudVmCluster lifecycle state. + public ExadbVmClusterLifecycleState? LifecycleState { get; } + /// VNET for network connectivity. + public ResourceIdentifier VnetId { get; set; } + /// Client subnet. + public ResourceIdentifier SubnetId { get; set; } + /// Indicates user preferences for the various diagnostic collection options for the VM cluster/Cloud VM cluster/VMBM DBCS. + public DataCollectionOptions DataCollectionOptions { get; set; } + /// Display Name. + public string DisplayName { get; set; } + /// A domain name used for the Exadata VM cluster on Exascale Infrastructure. + public string Domain { get; set; } + /// The number of ECPUs to enable for an Exadata VM cluster on Exascale Infrastructure. + public int EnabledEcpuCount { get; set; } + /// The Azure Resource ID of the Exadata Database Storage Vault. + public ResourceIdentifier ExascaleDbStorageVaultId { get; set; } + /// Grid Setup will be done using this Grid Image OCID. Can be obtained using giMinorVersions API. + public string GridImageOcid { get; set; } + /// The type of Grid Image. + public GridImageType? GridImageType { get; } + /// Oracle Grid Infrastructure (GI) software version. + public string GiVersion { get; } + /// The hostname for the Exadata VM cluster on Exascale Infrastructure. + public string Hostname { get; set; } + /// The Oracle license model that applies to the Exadata VM cluster on Exascale Infrastructure. The default is LICENSE_INCLUDED. + public LicenseModel? LicenseModel { get; set; } + /// The memory that you want to be allocated in GBs. Memory is calculated based on 11 GB per VM core reserved. + public int? MemorySizeInGbs { get; } + /// The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + public int NodeCount { get; set; } + /// CIDR blocks for additional NSG ingress rules. The VNET CIDRs used to provision the VM Cluster will be added by default. + public IList NsgCidrs { get; } + /// The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with. + public string ZoneOcid { get; } + /// The OCID of the zone the Exadata VM cluster on Exascale Infrastructure is associated with. + public string PrivateZoneOcid { get; set; } + /// The TCP Single Client Access Name (SCAN) port. The default port is 1521. + public int? ScanListenerPortTcp { get; set; } + /// The TCPS Single Client Access Name (SCAN) port. The default port is 2484. + public int? ScanListenerPortTcpSsl { get; set; } + /// The port number configured for the listener on the Exadata VM cluster on Exascale Infrastructure. + public int? ListenerPort { get; } + /// The shape of the Exadata VM cluster on Exascale Infrastructure resource. + public string Shape { get; set; } + /// The public key portion of one or more key pairs used for SSH access to the Exadata VM cluster on Exascale Infrastructure. + public IList SshPublicKeys { get; } + /// Operating system version of the image. + public string SystemVersion { get; set; } + /// The time zone of the Exadata VM cluster on Exascale Infrastructure. For details, see [Exadata Infrastructure Time Zones](/Content/Database/References/timezones.htm). + public string TimeZone { get; set; } + /// The number of Total ECPUs for an Exadata VM cluster on Exascale Infrastructure. + public int TotalEcpuCount { get; set; } + /// Filesystem storage details. + internal ExadbVmClusterStorageDetails VmFileSystemStorage { get; set; } + /// Total Capacity. + public int? VmFileSystemStorageTotalSizeInGbs + { + get => VmFileSystemStorage is null ? default(int?) : VmFileSystemStorage.TotalSizeInGbs; + set + { + VmFileSystemStorage = value.HasValue ? new ExadbVmClusterStorageDetails(value.Value) : null; + } + } + + /// Additional information about the current lifecycle state. + public string LifecycleDetails { get; } + /// The FQDN of the DNS record for the SCAN IP addresses that are associated with the Exadata VM cluster on Exascale Infrastructure. + public string ScanDnsName { get; } + /// The Single Client Access Name (SCAN) IP addresses associated with the Exadata VM cluster on Exascale Infrastructure. SCAN IP addresses are typically used for load balancing and are not assigned to any interface. Oracle Clusterware directs the requests to the appropriate nodes in the cluster. **Note:** For a single-node DB system, this list is empty. + public IReadOnlyList ScanIPIds { get; } + /// The OCID of the DNS record for the SCAN IP addresses that are associated with the Exadata VM cluster on Exascale Infrastructure. + public string ScanDnsRecordId { get; } + /// Snapshot filesystem storage details. + internal ExadbVmClusterStorageDetails SnapshotFileSystemStorage { get; } + /// Total Capacity. + public int? SnapshotFileSystemStorageTotalSizeInGbs + { + get => SnapshotFileSystemStorage?.TotalSizeInGbs; + } + + /// Total file system storage details. + internal ExadbVmClusterStorageDetails TotalFileSystemStorage { get; } + /// Total Capacity. + public int? TotalSizeInGbs + { + get => TotalFileSystemStorage?.TotalSizeInGbs; + } + + /// The virtual IP (VIP) addresses associated with the Exadata VM cluster on Exascale Infrastructure. The Cluster Ready Services (CRS) creates and maintains one VIP address for each node in the Exadata Cloud Service instance to enable failover. If one node fails, the VIP is reassigned to another active node in the cluster. **Note:** For a single-node DB system, this list is empty. + public IReadOnlyList VipIds { get; } + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + public Uri OciUri { get; } + /// iormConfigCache details for Exadata VM cluster on Exascale Infrastructure. + public ExadataIormConfig IormConfigCache { get; } + /// Cluster backup subnet ocid. + public string BackupSubnetOcid { get; } + /// Cluster subnet ocid. + public string SubnetOcid { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.Serialization.cs new file mode 100644 index 000000000000..28ec6f2eb1aa --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.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.OracleDatabase.Models +{ + public partial class ExadbVmClusterStorageDetails : 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(ExadbVmClusterStorageDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("totalSizeInGbs"u8); + writer.WriteNumberValue(TotalSizeInGbs); + 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 + } + } + } + + ExadbVmClusterStorageDetails 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(ExadbVmClusterStorageDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExadbVmClusterStorageDetails(document.RootElement, options); + } + + internal static ExadbVmClusterStorageDetails DeserializeExadbVmClusterStorageDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int totalSizeInGbs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("totalSizeInGbs"u8)) + { + totalSizeInGbs = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExadbVmClusterStorageDetails(totalSizeInGbs, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExadbVmClusterStorageDetails)} does not support writing '{options.Format}' format."); + } + } + + ExadbVmClusterStorageDetails 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 DeserializeExadbVmClusterStorageDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExadbVmClusterStorageDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.cs new file mode 100644 index 000000000000..0ba79b60cc13 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterStorageDetails.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Storage Details on the Exadata VM cluster. + public partial class ExadbVmClusterStorageDetails + { + /// + /// 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 . + /// Total Capacity. + public ExadbVmClusterStorageDetails(int totalSizeInGbs) + { + TotalSizeInGbs = totalSizeInGbs; + } + + /// Initializes a new instance of . + /// Total Capacity. + /// Keeps track of any properties unknown to the library. + internal ExadbVmClusterStorageDetails(int totalSizeInGbs, IDictionary serializedAdditionalRawData) + { + TotalSizeInGbs = totalSizeInGbs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExadbVmClusterStorageDetails() + { + } + + /// Total Capacity. + public int TotalSizeInGbs { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..bde831f19ebd --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.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.OracleDatabase.Models +{ + internal partial class ExadbVmClusterUpdateProperties : 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(ExadbVmClusterUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NodeCount)) + { + writer.WritePropertyName("nodeCount"u8); + writer.WriteNumberValue(NodeCount.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 + } + } + } + + ExadbVmClusterUpdateProperties 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(ExadbVmClusterUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExadbVmClusterUpdateProperties(document.RootElement, options); + } + + internal static ExadbVmClusterUpdateProperties DeserializeExadbVmClusterUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? nodeCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nodeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExadbVmClusterUpdateProperties(nodeCount, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExadbVmClusterUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + ExadbVmClusterUpdateProperties 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 DeserializeExadbVmClusterUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExadbVmClusterUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.cs new file mode 100644 index 000000000000..3ac212e4beed --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExadbVmClusterUpdateProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// The updatable properties of the ExadbVmCluster. + internal partial class ExadbVmClusterUpdateProperties + { + /// + /// 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 ExadbVmClusterUpdateProperties() + { + } + + /// Initializes a new instance of . + /// The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + /// Keeps track of any properties unknown to the library. + internal ExadbVmClusterUpdateProperties(int? nodeCount, IDictionary serializedAdditionalRawData) + { + NodeCount = nodeCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The number of nodes in the Exadata VM cluster on Exascale Infrastructure. + public int? NodeCount { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeListResult.Serialization.cs new file mode 100644 index 000000000000..5ab5d7326008 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeListResult.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.OracleDatabase.Models +{ + internal partial class ExascaleDbNodeListResult : 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(ExascaleDbNodeListResult)} 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 + } + } + } + + ExascaleDbNodeListResult 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(ExascaleDbNodeListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDbNodeListResult(document.RootElement, options); + } + + internal static ExascaleDbNodeListResult DeserializeExascaleDbNodeListResult(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(ExascaleDbNodeData.DeserializeExascaleDbNodeData(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 ExascaleDbNodeListResult(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); + default: + throw new FormatException($"The model {nameof(ExascaleDbNodeListResult)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDbNodeListResult 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 DeserializeExascaleDbNodeListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDbNodeListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeListResult.cs new file mode 100644 index 000000000000..2147beca326b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeListResult.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.OracleDatabase.Models +{ + /// The response of a ExascaleDbNode list operation. + internal partial class ExascaleDbNodeListResult + { + /// + /// 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 ExascaleDbNode items on this page. + /// is null. + internal ExascaleDbNodeListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ExascaleDbNode items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ExascaleDbNodeListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExascaleDbNodeListResult() + { + } + + /// The ExascaleDbNode items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeProperties.Serialization.cs new file mode 100644 index 000000000000..c87145a69a82 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeProperties.Serialization.cs @@ -0,0 +1,304 @@ +// 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.OracleDatabase.Models +{ + public partial class ExascaleDbNodeProperties : 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(ExascaleDbNodeProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + if (Optional.IsDefined(AdditionalDetails)) + { + writer.WritePropertyName("additionalDetails"u8); + writer.WriteStringValue(AdditionalDetails); + } + if (Optional.IsDefined(CpuCoreCount)) + { + writer.WritePropertyName("cpuCoreCount"u8); + writer.WriteNumberValue(CpuCoreCount.Value); + } + if (Optional.IsDefined(DbNodeStorageSizeInGbs)) + { + writer.WritePropertyName("dbNodeStorageSizeInGbs"u8); + writer.WriteNumberValue(DbNodeStorageSizeInGbs.Value); + } + if (Optional.IsDefined(FaultDomain)) + { + writer.WritePropertyName("faultDomain"u8); + writer.WriteStringValue(FaultDomain); + } + if (Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + } + if (Optional.IsDefined(LifecycleState)) + { + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.Value.ToString()); + } + if (Optional.IsDefined(MaintenanceType)) + { + writer.WritePropertyName("maintenanceType"u8); + writer.WriteStringValue(MaintenanceType); + } + if (Optional.IsDefined(MemorySizeInGbs)) + { + writer.WritePropertyName("memorySizeInGbs"u8); + writer.WriteNumberValue(MemorySizeInGbs.Value); + } + if (Optional.IsDefined(SoftwareStorageSizeInGb)) + { + writer.WritePropertyName("softwareStorageSizeInGb"u8); + writer.WriteNumberValue(SoftwareStorageSizeInGb.Value); + } + if (Optional.IsDefined(TimeMaintenanceWindowEnd)) + { + writer.WritePropertyName("timeMaintenanceWindowEnd"u8); + writer.WriteStringValue(TimeMaintenanceWindowEnd.Value, "O"); + } + if (Optional.IsDefined(TimeMaintenanceWindowStart)) + { + writer.WritePropertyName("timeMaintenanceWindowStart"u8); + writer.WriteStringValue(TimeMaintenanceWindowStart.Value, "O"); + } + if (Optional.IsDefined(TotalCpuCoreCount)) + { + writer.WritePropertyName("totalCpuCoreCount"u8); + writer.WriteNumberValue(TotalCpuCoreCount.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 + } + } + } + + ExascaleDbNodeProperties 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(ExascaleDbNodeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDbNodeProperties(document.RootElement, options); + } + + internal static ExascaleDbNodeProperties DeserializeExascaleDbNodeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string ocid = default; + string additionalDetails = default; + int? cpuCoreCount = default; + int? dbNodeStorageSizeInGbs = default; + string faultDomain = default; + string hostname = default; + DbNodeProvisioningState? lifecycleState = default; + string maintenanceType = default; + int? memorySizeInGbs = default; + int? softwareStorageSizeInGb = default; + DateTimeOffset? timeMaintenanceWindowEnd = default; + DateTimeOffset? timeMaintenanceWindowStart = default; + int? totalCpuCoreCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("additionalDetails"u8)) + { + additionalDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("cpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dbNodeStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbNodeStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("faultDomain"u8)) + { + faultDomain = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new DbNodeProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("maintenanceType"u8)) + { + maintenanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("memorySizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memorySizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("softwareStorageSizeInGb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softwareStorageSizeInGb = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeMaintenanceWindowEnd"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceWindowEnd = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceWindowStart"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceWindowStart = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("totalCpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalCpuCoreCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExascaleDbNodeProperties( + ocid, + additionalDetails, + cpuCoreCount, + dbNodeStorageSizeInGbs, + faultDomain, + hostname, + lifecycleState, + maintenanceType, + memorySizeInGbs, + softwareStorageSizeInGb, + timeMaintenanceWindowEnd, + timeMaintenanceWindowStart, + totalCpuCoreCount, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExascaleDbNodeProperties)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDbNodeProperties 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 DeserializeExascaleDbNodeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDbNodeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeProperties.cs new file mode 100644 index 000000000000..3a1c65e0b9ed --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbNodeProperties.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; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// The properties of DbNodeResource. + public partial class ExascaleDbNodeProperties + { + /// + /// 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 . + /// DbNode OCID. + /// is null. + internal ExascaleDbNodeProperties(string ocid) + { + Argument.AssertNotNull(ocid, nameof(ocid)); + + Ocid = ocid; + } + + /// Initializes a new instance of . + /// DbNode OCID. + /// Additional information about the planned maintenance. + /// The number of CPU cores enabled on the Db node. + /// The allocated local node storage in GBs on the Db node. + /// The name of the Fault Domain the instance is contained in. + /// The host name for the database node. + /// The current state of the database node. + /// The type of database node maintenance. + /// The allocated memory in GBs on the Db node. + /// The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine DB systems. + /// End date and time of maintenance window. + /// Start date and time of maintenance window. + /// The total number of CPU cores reserved on the Db node. + /// Keeps track of any properties unknown to the library. + internal ExascaleDbNodeProperties(string ocid, string additionalDetails, int? cpuCoreCount, int? dbNodeStorageSizeInGbs, string faultDomain, string hostname, DbNodeProvisioningState? lifecycleState, string maintenanceType, int? memorySizeInGbs, int? softwareStorageSizeInGb, DateTimeOffset? timeMaintenanceWindowEnd, DateTimeOffset? timeMaintenanceWindowStart, int? totalCpuCoreCount, IDictionary serializedAdditionalRawData) + { + Ocid = ocid; + AdditionalDetails = additionalDetails; + CpuCoreCount = cpuCoreCount; + DbNodeStorageSizeInGbs = dbNodeStorageSizeInGbs; + FaultDomain = faultDomain; + Hostname = hostname; + LifecycleState = lifecycleState; + MaintenanceType = maintenanceType; + MemorySizeInGbs = memorySizeInGbs; + SoftwareStorageSizeInGb = softwareStorageSizeInGb; + TimeMaintenanceWindowEnd = timeMaintenanceWindowEnd; + TimeMaintenanceWindowStart = timeMaintenanceWindowStart; + TotalCpuCoreCount = totalCpuCoreCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExascaleDbNodeProperties() + { + } + + /// DbNode OCID. + public string Ocid { get; } + /// Additional information about the planned maintenance. + public string AdditionalDetails { get; } + /// The number of CPU cores enabled on the Db node. + public int? CpuCoreCount { get; } + /// The allocated local node storage in GBs on the Db node. + public int? DbNodeStorageSizeInGbs { get; } + /// The name of the Fault Domain the instance is contained in. + public string FaultDomain { get; } + /// The host name for the database node. + public string Hostname { get; } + /// The current state of the database node. + public DbNodeProvisioningState? LifecycleState { get; } + /// The type of database node maintenance. + public string MaintenanceType { get; } + /// The allocated memory in GBs on the Db node. + public int? MemorySizeInGbs { get; } + /// The size (in GB) of the block storage volume allocation for the DB system. This attribute applies only for virtual machine DB systems. + public int? SoftwareStorageSizeInGb { get; } + /// End date and time of maintenance window. + public DateTimeOffset? TimeMaintenanceWindowEnd { get; } + /// Start date and time of maintenance window. + public DateTimeOffset? TimeMaintenanceWindowStart { get; } + /// The total number of CPU cores reserved on the Db node. + public int? TotalCpuCoreCount { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageDetails.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageDetails.Serialization.cs new file mode 100644 index 000000000000..c9571560501b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageDetails.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.OracleDatabase.Models +{ + public partial class ExascaleDbStorageDetails : 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(ExascaleDbStorageDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AvailableSizeInGbs)) + { + writer.WritePropertyName("availableSizeInGbs"u8); + writer.WriteNumberValue(AvailableSizeInGbs.Value); + } + if (Optional.IsDefined(TotalSizeInGbs)) + { + writer.WritePropertyName("totalSizeInGbs"u8); + writer.WriteNumberValue(TotalSizeInGbs.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 + } + } + } + + ExascaleDbStorageDetails 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(ExascaleDbStorageDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDbStorageDetails(document.RootElement, options); + } + + internal static ExascaleDbStorageDetails DeserializeExascaleDbStorageDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? availableSizeInGbs = default; + int? totalSizeInGbs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("availableSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("totalSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalSizeInGbs = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExascaleDbStorageDetails(availableSizeInGbs, totalSizeInGbs, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExascaleDbStorageDetails)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDbStorageDetails 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 DeserializeExascaleDbStorageDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDbStorageDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageDetails.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageDetails.cs new file mode 100644 index 000000000000..39969192abc1 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageDetails.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.OracleDatabase.Models +{ + /// Exadata Database Storage Details. + public partial class ExascaleDbStorageDetails + { + /// + /// 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 ExascaleDbStorageDetails() + { + } + + /// Initializes a new instance of . + /// Available Capacity. + /// Total Capacity. + /// Keeps track of any properties unknown to the library. + internal ExascaleDbStorageDetails(int? availableSizeInGbs, int? totalSizeInGbs, IDictionary serializedAdditionalRawData) + { + AvailableSizeInGbs = availableSizeInGbs; + TotalSizeInGbs = totalSizeInGbs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Available Capacity. + public int? AvailableSizeInGbs { get; } + /// Total Capacity. + public int? TotalSizeInGbs { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageInputDetails.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageInputDetails.Serialization.cs new file mode 100644 index 000000000000..93d3a0833aea --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageInputDetails.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.OracleDatabase.Models +{ + public partial class ExascaleDbStorageInputDetails : 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(ExascaleDbStorageInputDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("totalSizeInGbs"u8); + writer.WriteNumberValue(TotalSizeInGbs); + 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 + } + } + } + + ExascaleDbStorageInputDetails 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(ExascaleDbStorageInputDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDbStorageInputDetails(document.RootElement, options); + } + + internal static ExascaleDbStorageInputDetails DeserializeExascaleDbStorageInputDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int totalSizeInGbs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("totalSizeInGbs"u8)) + { + totalSizeInGbs = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExascaleDbStorageInputDetails(totalSizeInGbs, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExascaleDbStorageInputDetails)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDbStorageInputDetails 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 DeserializeExascaleDbStorageInputDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDbStorageInputDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageInputDetails.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageInputDetails.cs new file mode 100644 index 000000000000..cb7a178fdead --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageInputDetails.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Create exadata Database Storage Details model. + public partial class ExascaleDbStorageInputDetails + { + /// + /// 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 . + /// Total Capacity. + public ExascaleDbStorageInputDetails(int totalSizeInGbs) + { + TotalSizeInGbs = totalSizeInGbs; + } + + /// Initializes a new instance of . + /// Total Capacity. + /// Keeps track of any properties unknown to the library. + internal ExascaleDbStorageInputDetails(int totalSizeInGbs, IDictionary serializedAdditionalRawData) + { + TotalSizeInGbs = totalSizeInGbs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExascaleDbStorageInputDetails() + { + } + + /// Total Capacity. + public int TotalSizeInGbs { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultLifecycleState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultLifecycleState.cs new file mode 100644 index 000000000000..f94c70393a40 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultLifecycleState.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.OracleDatabase.Models +{ + /// Exadata Database Storage Vault lifecycle state enum. + public readonly partial struct ExascaleDbStorageVaultLifecycleState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ExascaleDbStorageVaultLifecycleState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProvisioningValue = "Provisioning"; + private const string AvailableValue = "Available"; + private const string UpdatingValue = "Updating"; + private const string TerminatingValue = "Terminating"; + private const string TerminatedValue = "Terminated"; + private const string FailedValue = "Failed"; + + /// Indicates that resource in Provisioning state. + public static ExascaleDbStorageVaultLifecycleState Provisioning { get; } = new ExascaleDbStorageVaultLifecycleState(ProvisioningValue); + /// Indicates that resource in Available state. + public static ExascaleDbStorageVaultLifecycleState Available { get; } = new ExascaleDbStorageVaultLifecycleState(AvailableValue); + /// Indicates that resource in Updating state. + public static ExascaleDbStorageVaultLifecycleState Updating { get; } = new ExascaleDbStorageVaultLifecycleState(UpdatingValue); + /// Indicates that resource in Terminating state. + public static ExascaleDbStorageVaultLifecycleState Terminating { get; } = new ExascaleDbStorageVaultLifecycleState(TerminatingValue); + /// Indicates that resource in Terminated state. + public static ExascaleDbStorageVaultLifecycleState Terminated { get; } = new ExascaleDbStorageVaultLifecycleState(TerminatedValue); + /// Indicates that resource in Failed state. + public static ExascaleDbStorageVaultLifecycleState Failed { get; } = new ExascaleDbStorageVaultLifecycleState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(ExascaleDbStorageVaultLifecycleState left, ExascaleDbStorageVaultLifecycleState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ExascaleDbStorageVaultLifecycleState left, ExascaleDbStorageVaultLifecycleState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ExascaleDbStorageVaultLifecycleState(string value) => new ExascaleDbStorageVaultLifecycleState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ExascaleDbStorageVaultLifecycleState other && Equals(other); + /// + public bool Equals(ExascaleDbStorageVaultLifecycleState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultListResult.Serialization.cs new file mode 100644 index 000000000000..3770a3ddd200 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultListResult.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.OracleDatabase.Models +{ + internal partial class ExascaleDbStorageVaultListResult : 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(ExascaleDbStorageVaultListResult)} 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 + } + } + } + + ExascaleDbStorageVaultListResult 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(ExascaleDbStorageVaultListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDbStorageVaultListResult(document.RootElement, options); + } + + internal static ExascaleDbStorageVaultListResult DeserializeExascaleDbStorageVaultListResult(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(ExascaleDbStorageVaultData.DeserializeExascaleDbStorageVaultData(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 ExascaleDbStorageVaultListResult(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); + default: + throw new FormatException($"The model {nameof(ExascaleDbStorageVaultListResult)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDbStorageVaultListResult 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 DeserializeExascaleDbStorageVaultListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDbStorageVaultListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultListResult.cs new file mode 100644 index 000000000000..a68d8fd498e2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultListResult.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.OracleDatabase.Models +{ + /// The response of a ExascaleDbStorageVault list operation. + internal partial class ExascaleDbStorageVaultListResult + { + /// + /// 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 ExascaleDbStorageVault items on this page. + /// is null. + internal ExascaleDbStorageVaultListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ExascaleDbStorageVault items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ExascaleDbStorageVaultListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExascaleDbStorageVaultListResult() + { + } + + /// The ExascaleDbStorageVault items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultPatch.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultPatch.Serialization.cs new file mode 100644 index 000000000000..87fde95c8ad2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultPatch.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.OracleDatabase.Models +{ + public partial class ExascaleDbStorageVaultPatch : 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(ExascaleDbStorageVaultPatch)} does not support writing '{format}' format."); + } + + 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 (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 + } + } + } + + ExascaleDbStorageVaultPatch 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(ExascaleDbStorageVaultPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDbStorageVaultPatch(document.RootElement, options); + } + + internal static ExascaleDbStorageVaultPatch DeserializeExascaleDbStorageVaultPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = 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 (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExascaleDbStorageVaultPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExascaleDbStorageVaultPatch)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDbStorageVaultPatch 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 DeserializeExascaleDbStorageVaultPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDbStorageVaultPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultPatch.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultPatch.cs new file mode 100644 index 000000000000..a623406ccb8f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultPatch.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.OracleDatabase.Models +{ + /// The type used for updating tags in ExascaleDbStorageVault resources. + public partial class ExascaleDbStorageVaultPatch + { + /// + /// 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 ExascaleDbStorageVaultPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Keeps track of any properties unknown to the library. + internal ExascaleDbStorageVaultPatch(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultProperties.Serialization.cs new file mode 100644 index 000000000000..f41710e24dec --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultProperties.Serialization.cs @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + public partial class ExascaleDbStorageVaultProperties : 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(ExascaleDbStorageVaultProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AdditionalFlashCacheInPercent)) + { + writer.WritePropertyName("additionalFlashCacheInPercent"u8); + writer.WriteNumberValue(AdditionalFlashCacheInPercent.Value); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + writer.WritePropertyName("highCapacityDatabaseStorageInput"u8); + writer.WriteObjectValue(HighCapacityDatabaseStorageInput, options); + if (options.Format != "W" && Optional.IsDefined(HighCapacityDatabaseStorage)) + { + writer.WritePropertyName("highCapacityDatabaseStorage"u8); + writer.WriteObjectValue(HighCapacityDatabaseStorage, options); + } + if (Optional.IsDefined(TimeZone)) + { + writer.WritePropertyName("timeZone"u8); + writer.WriteStringValue(TimeZone); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleState)) + { + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleDetails)) + { + writer.WritePropertyName("lifecycleDetails"u8); + writer.WriteStringValue(LifecycleDetails); + } + if (options.Format != "W" && Optional.IsDefined(VmClusterCount)) + { + writer.WritePropertyName("vmClusterCount"u8); + writer.WriteNumberValue(VmClusterCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(Ocid)) + { + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + } + if (options.Format != "W" && Optional.IsDefined(OciUri)) + { + writer.WritePropertyName("ociUrl"u8); + writer.WriteStringValue(OciUri.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 + } + } + } + + ExascaleDbStorageVaultProperties 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(ExascaleDbStorageVaultProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExascaleDbStorageVaultProperties(document.RootElement, options); + } + + internal static ExascaleDbStorageVaultProperties DeserializeExascaleDbStorageVaultProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? additionalFlashCacheInPercent = default; + string description = default; + string displayName = default; + ExascaleDbStorageInputDetails highCapacityDatabaseStorageInput = default; + ExascaleDbStorageDetails highCapacityDatabaseStorage = default; + string timeZone = default; + AzureResourceProvisioningState? provisioningState = default; + ExascaleDbStorageVaultLifecycleState? lifecycleState = default; + string lifecycleDetails = default; + int? vmClusterCount = default; + string ocid = default; + Uri ociUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("additionalFlashCacheInPercent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + additionalFlashCacheInPercent = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("highCapacityDatabaseStorageInput"u8)) + { + highCapacityDatabaseStorageInput = ExascaleDbStorageInputDetails.DeserializeExascaleDbStorageInputDetails(property.Value, options); + continue; + } + if (property.NameEquals("highCapacityDatabaseStorage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highCapacityDatabaseStorage = ExascaleDbStorageDetails.DeserializeExascaleDbStorageDetails(property.Value, options); + continue; + } + if (property.NameEquals("timeZone"u8)) + { + timeZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new ExascaleDbStorageVaultLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("vmClusterCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vmClusterCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("ociUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ociUrl = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExascaleDbStorageVaultProperties( + additionalFlashCacheInPercent, + description, + displayName, + highCapacityDatabaseStorageInput, + highCapacityDatabaseStorage, + timeZone, + provisioningState, + lifecycleState, + lifecycleDetails, + vmClusterCount, + ocid, + ociUrl, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ExascaleDbStorageVaultProperties)} does not support writing '{options.Format}' format."); + } + } + + ExascaleDbStorageVaultProperties 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 DeserializeExascaleDbStorageVaultProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExascaleDbStorageVaultProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultProperties.cs new file mode 100644 index 000000000000..65d84b30dc11 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ExascaleDbStorageVaultProperties.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// ExascaleDbStorageVault resource model. + public partial class ExascaleDbStorageVaultProperties + { + /// + /// 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 user-friendly name for the Exadata Database Storage Vault. The name does not need to be unique. + /// Create exadata Database Storage Details. + /// or is null. + public ExascaleDbStorageVaultProperties(string displayName, ExascaleDbStorageInputDetails highCapacityDatabaseStorageInput) + { + Argument.AssertNotNull(displayName, nameof(displayName)); + Argument.AssertNotNull(highCapacityDatabaseStorageInput, nameof(highCapacityDatabaseStorageInput)); + + DisplayName = displayName; + HighCapacityDatabaseStorageInput = highCapacityDatabaseStorageInput; + } + + /// Initializes a new instance of . + /// The size of additional Flash Cache in percentage of High Capacity database storage. + /// Exadata Database Storage Vault description. + /// The user-friendly name for the Exadata Database Storage Vault. The name does not need to be unique. + /// Create exadata Database Storage Details. + /// Response exadata Database Storage Details. + /// The time zone that you want to use for the Exadata Database Storage Vault. + /// Exadata Database Storage Vault provisioning state. + /// Exadata Database Storage Vault lifecycle state. + /// Additional information about the current lifecycle state. + /// The number of Exadata VM clusters used the Exadata Database Storage Vault. + /// The OCID of the Exadata Database Storage Vault. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Keeps track of any properties unknown to the library. + internal ExascaleDbStorageVaultProperties(int? additionalFlashCacheInPercent, string description, string displayName, ExascaleDbStorageInputDetails highCapacityDatabaseStorageInput, ExascaleDbStorageDetails highCapacityDatabaseStorage, string timeZone, AzureResourceProvisioningState? provisioningState, ExascaleDbStorageVaultLifecycleState? lifecycleState, string lifecycleDetails, int? vmClusterCount, string ocid, Uri ociUri, IDictionary serializedAdditionalRawData) + { + AdditionalFlashCacheInPercent = additionalFlashCacheInPercent; + Description = description; + DisplayName = displayName; + HighCapacityDatabaseStorageInput = highCapacityDatabaseStorageInput; + HighCapacityDatabaseStorage = highCapacityDatabaseStorage; + TimeZone = timeZone; + ProvisioningState = provisioningState; + LifecycleState = lifecycleState; + LifecycleDetails = lifecycleDetails; + VmClusterCount = vmClusterCount; + Ocid = ocid; + OciUri = ociUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExascaleDbStorageVaultProperties() + { + } + + /// The size of additional Flash Cache in percentage of High Capacity database storage. + public int? AdditionalFlashCacheInPercent { get; set; } + /// Exadata Database Storage Vault description. + public string Description { get; set; } + /// The user-friendly name for the Exadata Database Storage Vault. The name does not need to be unique. + public string DisplayName { get; set; } + /// Create exadata Database Storage Details. + internal ExascaleDbStorageInputDetails HighCapacityDatabaseStorageInput { get; set; } + /// Total Capacity. + public int? HighCapacityDatabaseStorageInputTotalSizeInGbs + { + get => HighCapacityDatabaseStorageInput is null ? default(int?) : HighCapacityDatabaseStorageInput.TotalSizeInGbs; + set + { + HighCapacityDatabaseStorageInput = value.HasValue ? new ExascaleDbStorageInputDetails(value.Value) : null; + } + } + + /// Response exadata Database Storage Details. + public ExascaleDbStorageDetails HighCapacityDatabaseStorage { get; } + /// The time zone that you want to use for the Exadata Database Storage Vault. + public string TimeZone { get; set; } + /// Exadata Database Storage Vault provisioning state. + public AzureResourceProvisioningState? ProvisioningState { get; } + /// Exadata Database Storage Vault lifecycle state. + public ExascaleDbStorageVaultLifecycleState? LifecycleState { get; } + /// Additional information about the current lifecycle state. + public string LifecycleDetails { get; } + /// The number of Exadata VM clusters used the Exadata Database Storage Vault. + public int? VmClusterCount { get; } + /// The OCID of the Exadata Database Storage Vault. + public string Ocid { get; } + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + public Uri OciUri { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.Serialization.cs new file mode 100644 index 000000000000..2e16921c5fc5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.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.OracleDatabase.Models +{ + public partial class FileSystemConfigurationDetails : 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(FileSystemConfigurationDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(MountPoint)) + { + writer.WritePropertyName("mountPoint"u8); + writer.WriteStringValue(MountPoint); + } + if (Optional.IsDefined(FileSystemSizeGb)) + { + writer.WritePropertyName("fileSystemSizeGb"u8); + writer.WriteNumberValue(FileSystemSizeGb.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 + } + } + } + + FileSystemConfigurationDetails 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(FileSystemConfigurationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFileSystemConfigurationDetails(document.RootElement, options); + } + + internal static FileSystemConfigurationDetails DeserializeFileSystemConfigurationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string mountPoint = default; + int? fileSystemSizeGb = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mountPoint"u8)) + { + mountPoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("fileSystemSizeGb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fileSystemSizeGb = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FileSystemConfigurationDetails(mountPoint, fileSystemSizeGb, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FileSystemConfigurationDetails)} does not support writing '{options.Format}' format."); + } + } + + FileSystemConfigurationDetails 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 DeserializeFileSystemConfigurationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FileSystemConfigurationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.cs new file mode 100644 index 000000000000..260492d0d899 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FileSystemConfigurationDetails.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.OracleDatabase.Models +{ + /// File configuration options. + public partial class FileSystemConfigurationDetails + { + /// + /// 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 FileSystemConfigurationDetails() + { + } + + /// Initializes a new instance of . + /// Mount path. + /// Size of the VM. + /// Keeps track of any properties unknown to the library. + internal FileSystemConfigurationDetails(string mountPoint, int? fileSystemSizeGb, IDictionary serializedAdditionalRawData) + { + MountPoint = mountPoint; + FileSystemSizeGb = fileSystemSizeGb; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Mount path. + public string MountPoint { get; set; } + /// Size of the VM. + public int? FileSystemSizeGb { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.Serialization.cs new file mode 100644 index 000000000000..ca02f1e1ecae --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.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.OracleDatabase.Models +{ + internal partial class FlexComponentListResult : 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(FlexComponentListResult)} 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 + } + } + } + + FlexComponentListResult 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(FlexComponentListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFlexComponentListResult(document.RootElement, options); + } + + internal static FlexComponentListResult DeserializeFlexComponentListResult(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(FlexComponentData.DeserializeFlexComponentData(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 FlexComponentListResult(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); + default: + throw new FormatException($"The model {nameof(FlexComponentListResult)} does not support writing '{options.Format}' format."); + } + } + + FlexComponentListResult 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 DeserializeFlexComponentListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FlexComponentListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.cs new file mode 100644 index 000000000000..35dd7659fe1f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentListResult.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.OracleDatabase.Models +{ + /// The response of a FlexComponent list operation. + internal partial class FlexComponentListResult + { + /// + /// 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 FlexComponent items on this page. + /// is null. + internal FlexComponentListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FlexComponent items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FlexComponentListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FlexComponentListResult() + { + } + + /// The FlexComponent items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.Serialization.cs new file mode 100644 index 000000000000..8aea3244784d --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.Serialization.cs @@ -0,0 +1,267 @@ +// 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.OracleDatabase.Models +{ + public partial class FlexComponentProperties : 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(FlexComponentProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(MinimumCoreCount)) + { + writer.WritePropertyName("minimumCoreCount"u8); + writer.WriteNumberValue(MinimumCoreCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(AvailableCoreCount)) + { + writer.WritePropertyName("availableCoreCount"u8); + writer.WriteNumberValue(AvailableCoreCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(AvailableDbStorageInGbs)) + { + writer.WritePropertyName("availableDbStorageInGbs"u8); + writer.WriteNumberValue(AvailableDbStorageInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(RuntimeMinimumCoreCount)) + { + writer.WritePropertyName("runtimeMinimumCoreCount"u8); + writer.WriteNumberValue(RuntimeMinimumCoreCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(Shape)) + { + writer.WritePropertyName("shape"u8); + writer.WriteStringValue(Shape); + } + if (options.Format != "W" && Optional.IsDefined(AvailableMemoryInGbs)) + { + writer.WritePropertyName("availableMemoryInGbs"u8); + writer.WriteNumberValue(AvailableMemoryInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(AvailableLocalStorageInGbs)) + { + writer.WritePropertyName("availableLocalStorageInGbs"u8); + writer.WriteNumberValue(AvailableLocalStorageInGbs.Value); + } + if (options.Format != "W" && Optional.IsDefined(ComputeModel)) + { + writer.WritePropertyName("computeModel"u8); + writer.WriteStringValue(ComputeModel); + } + if (options.Format != "W" && Optional.IsDefined(HardwareType)) + { + writer.WritePropertyName("hardwareType"u8); + writer.WriteStringValue(HardwareType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(DescriptionSummary)) + { + writer.WritePropertyName("descriptionSummary"u8); + writer.WriteStringValue(DescriptionSummary); + } + 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 + } + } + } + + FlexComponentProperties 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(FlexComponentProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFlexComponentProperties(document.RootElement, options); + } + + internal static FlexComponentProperties DeserializeFlexComponentProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? minimumCoreCount = default; + int? availableCoreCount = default; + int? availableDbStorageInGbs = default; + int? runtimeMinimumCoreCount = default; + string shape = default; + int? availableMemoryInGbs = default; + int? availableLocalStorageInGbs = default; + string computeModel = default; + HardwareType? hardwareType = default; + string descriptionSummary = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("minimumCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minimumCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("availableCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("availableDbStorageInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableDbStorageInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("runtimeMinimumCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + runtimeMinimumCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("shape"u8)) + { + shape = property.Value.GetString(); + continue; + } + if (property.NameEquals("availableMemoryInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableMemoryInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("availableLocalStorageInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availableLocalStorageInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("computeModel"u8)) + { + computeModel = property.Value.GetString(); + continue; + } + if (property.NameEquals("hardwareType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hardwareType = new HardwareType(property.Value.GetString()); + continue; + } + if (property.NameEquals("descriptionSummary"u8)) + { + descriptionSummary = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FlexComponentProperties( + minimumCoreCount, + availableCoreCount, + availableDbStorageInGbs, + runtimeMinimumCoreCount, + shape, + availableMemoryInGbs, + availableLocalStorageInGbs, + computeModel, + hardwareType, + descriptionSummary, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FlexComponentProperties)} does not support writing '{options.Format}' format."); + } + } + + FlexComponentProperties 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 DeserializeFlexComponentProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FlexComponentProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.cs new file mode 100644 index 000000000000..3854f94d2886 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/FlexComponentProperties.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.OracleDatabase.Models +{ + /// FlexComponent resource model. + public partial class FlexComponentProperties + { + /// + /// 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 FlexComponentProperties() + { + } + + /// Initializes a new instance of . + /// The minimum number of CPU cores that can be enabled on the DB Server for this Flex Component. + /// The maximum number of CPU cores that can be enabled on the DB Server for this Flex Component. + /// The maximum storage that can be enabled on the Storage Server for this Flex Component. + /// The runtime minimum number of CPU cores that can be enabled for this Flex Component. + /// The name of the DB system shape for this Flex Component. + /// The maximum memory size that can be enabled on the DB Server for this Flex Component. + /// The maximum local storage that can be enabled on the DB Server for this Flex Component. + /// The compute model of the DB Server for this Flex Component. + /// The hardware type of the DB (Compute) or Storage (Cell) Server for this Flex Component. + /// The description summary for this Flex Component. + /// Keeps track of any properties unknown to the library. + internal FlexComponentProperties(int? minimumCoreCount, int? availableCoreCount, int? availableDbStorageInGbs, int? runtimeMinimumCoreCount, string shape, int? availableMemoryInGbs, int? availableLocalStorageInGbs, string computeModel, HardwareType? hardwareType, string descriptionSummary, IDictionary serializedAdditionalRawData) + { + MinimumCoreCount = minimumCoreCount; + AvailableCoreCount = availableCoreCount; + AvailableDbStorageInGbs = availableDbStorageInGbs; + RuntimeMinimumCoreCount = runtimeMinimumCoreCount; + Shape = shape; + AvailableMemoryInGbs = availableMemoryInGbs; + AvailableLocalStorageInGbs = availableLocalStorageInGbs; + ComputeModel = computeModel; + HardwareType = hardwareType; + DescriptionSummary = descriptionSummary; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The minimum number of CPU cores that can be enabled on the DB Server for this Flex Component. + public int? MinimumCoreCount { get; } + /// The maximum number of CPU cores that can be enabled on the DB Server for this Flex Component. + public int? AvailableCoreCount { get; } + /// The maximum storage that can be enabled on the Storage Server for this Flex Component. + public int? AvailableDbStorageInGbs { get; } + /// The runtime minimum number of CPU cores that can be enabled for this Flex Component. + public int? RuntimeMinimumCoreCount { get; } + /// The name of the DB system shape for this Flex Component. + public string Shape { get; } + /// The maximum memory size that can be enabled on the DB Server for this Flex Component. + public int? AvailableMemoryInGbs { get; } + /// The maximum local storage that can be enabled on the DB Server for this Flex Component. + public int? AvailableLocalStorageInGbs { get; } + /// The compute model of the DB Server for this Flex Component. + public string ComputeModel { get; } + /// The hardware type of the DB (Compute) or Storage (Cell) Server for this Flex Component. + public HardwareType? HardwareType { get; } + /// The description summary for this Flex Component. + public string DescriptionSummary { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GenerateAutonomousDatabaseWalletDetails.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GenerateAutonomousDatabaseWalletDetails.Serialization.cs new file mode 100644 index 000000000000..981e327c3cfd --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GenerateAutonomousDatabaseWalletDetails.Serialization.cs @@ -0,0 +1,156 @@ +// 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.OracleDatabase.Models +{ + public partial class GenerateAutonomousDatabaseWalletDetails : 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(GenerateAutonomousDatabaseWalletDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(GenerateType)) + { + writer.WritePropertyName("generateType"u8); + writer.WriteStringValue(GenerateType.Value.ToString()); + } + if (Optional.IsDefined(IsRegional)) + { + writer.WritePropertyName("isRegional"u8); + writer.WriteBooleanValue(IsRegional.Value); + } + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + 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 + } + } + } + + GenerateAutonomousDatabaseWalletDetails 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(GenerateAutonomousDatabaseWalletDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGenerateAutonomousDatabaseWalletDetails(document.RootElement, options); + } + + internal static GenerateAutonomousDatabaseWalletDetails DeserializeGenerateAutonomousDatabaseWalletDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + GenerateType? generateType = default; + bool? isRegional = default; + string password = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("generateType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + generateType = new GenerateType(property.Value.GetString()); + continue; + } + if (property.NameEquals("isRegional"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isRegional = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("password"u8)) + { + password = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GenerateAutonomousDatabaseWalletDetails(generateType, isRegional, password, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GenerateAutonomousDatabaseWalletDetails)} does not support writing '{options.Format}' format."); + } + } + + GenerateAutonomousDatabaseWalletDetails 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 DeserializeGenerateAutonomousDatabaseWalletDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GenerateAutonomousDatabaseWalletDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GenerateAutonomousDatabaseWalletDetails.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GenerateAutonomousDatabaseWalletDetails.cs new file mode 100644 index 000000000000..9854b4251fc1 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GenerateAutonomousDatabaseWalletDetails.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; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Autonomous Database Generate Wallet resource model. + public partial class GenerateAutonomousDatabaseWalletDetails + { + /// + /// 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 password to encrypt the keys inside the wallet. + /// is null. + public GenerateAutonomousDatabaseWalletDetails(string password) + { + Argument.AssertNotNull(password, nameof(password)); + + Password = password; + } + + /// Initializes a new instance of . + /// The type of wallet to generate. + /// True when requesting regional connection strings in PDB connect info, applicable to cross-region DG only. + /// The password to encrypt the keys inside the wallet. + /// Keeps track of any properties unknown to the library. + internal GenerateAutonomousDatabaseWalletDetails(GenerateType? generateType, bool? isRegional, string password, IDictionary serializedAdditionalRawData) + { + GenerateType = generateType; + IsRegional = isRegional; + Password = password; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GenerateAutonomousDatabaseWalletDetails() + { + } + + /// The type of wallet to generate. + public GenerateType? GenerateType { get; set; } + /// True when requesting regional connection strings in PDB connect info, applicable to cross-region DG only. + public bool? IsRegional { get; set; } + /// The password to encrypt the keys inside the wallet. + public string Password { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GenerateType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GenerateType.cs new file mode 100644 index 000000000000..df927b5554e2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GenerateType.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.OracleDatabase.Models +{ + /// Generate type enum. + public readonly partial struct GenerateType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public GenerateType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SingleValue = "Single"; + private const string AllValue = "All"; + + /// Generate single. + public static GenerateType Single { get; } = new GenerateType(SingleValue); + /// Generate all. + public static GenerateType All { get; } = new GenerateType(AllValue); + /// Determines if two values are the same. + public static bool operator ==(GenerateType left, GenerateType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(GenerateType left, GenerateType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator GenerateType(string value) => new GenerateType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is GenerateType other && Equals(other); + /// + public bool Equals(GenerateType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.Serialization.cs new file mode 100644 index 000000000000..988ccb84a18b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.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.OracleDatabase.Models +{ + internal partial class GiMinorVersionListResult : 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(GiMinorVersionListResult)} 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 + } + } + } + + GiMinorVersionListResult 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(GiMinorVersionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGiMinorVersionListResult(document.RootElement, options); + } + + internal static GiMinorVersionListResult DeserializeGiMinorVersionListResult(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(GiMinorVersionData.DeserializeGiMinorVersionData(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 GiMinorVersionListResult(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); + default: + throw new FormatException($"The model {nameof(GiMinorVersionListResult)} does not support writing '{options.Format}' format."); + } + } + + GiMinorVersionListResult 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 DeserializeGiMinorVersionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GiMinorVersionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.cs new file mode 100644 index 000000000000..6f40be5d6c95 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionListResult.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.OracleDatabase.Models +{ + /// The response of a GiMinorVersion list operation. + internal partial class GiMinorVersionListResult + { + /// + /// 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 GiMinorVersion items on this page. + /// is null. + internal GiMinorVersionListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The GiMinorVersion items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal GiMinorVersionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GiMinorVersionListResult() + { + } + + /// The GiMinorVersion items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.Serialization.cs new file mode 100644 index 000000000000..cc1ddf6f1582 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.Serialization.cs @@ -0,0 +1,137 @@ +// 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.OracleDatabase.Models +{ + public partial class GiMinorVersionProperties : 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(GiMinorVersionProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + if (Optional.IsDefined(GridImageOcid)) + { + writer.WritePropertyName("gridImageOcid"u8); + writer.WriteStringValue(GridImageOcid); + } + 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 + } + } + } + + GiMinorVersionProperties 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(GiMinorVersionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGiMinorVersionProperties(document.RootElement, options); + } + + internal static GiMinorVersionProperties DeserializeGiMinorVersionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string version = default; + string gridImageOcid = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("gridImageOcid"u8)) + { + gridImageOcid = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GiMinorVersionProperties(version, gridImageOcid, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GiMinorVersionProperties)} does not support writing '{options.Format}' format."); + } + } + + GiMinorVersionProperties 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 DeserializeGiMinorVersionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GiMinorVersionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.cs new file mode 100644 index 000000000000..d4c6d427a466 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiMinorVersionProperties.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.OracleDatabase.Models +{ + /// The Oracle Grid Infrastructure (GI) minor version properties. + public partial class GiMinorVersionProperties + { + /// + /// 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 . + /// A valid Oracle Grid Infrastructure (GI) software version. + /// is null. + internal GiMinorVersionProperties(string version) + { + Argument.AssertNotNull(version, nameof(version)); + + Version = version; + } + + /// Initializes a new instance of . + /// A valid Oracle Grid Infrastructure (GI) software version. + /// Grid Infrastructure Image Id. + /// Keeps track of any properties unknown to the library. + internal GiMinorVersionProperties(string version, string gridImageOcid, IDictionary serializedAdditionalRawData) + { + Version = version; + GridImageOcid = gridImageOcid; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GiMinorVersionProperties() + { + } + + /// A valid Oracle Grid Infrastructure (GI) software version. + public string Version { get; } + /// Grid Infrastructure Image Id. + public string GridImageOcid { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionListResult.Serialization.cs new file mode 100644 index 000000000000..88dab947d2fe --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionListResult.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.OracleDatabase.Models +{ + internal partial class GiVersionListResult : 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(GiVersionListResult)} 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 + } + } + } + + GiVersionListResult 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(GiVersionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGiVersionListResult(document.RootElement, options); + } + + internal static GiVersionListResult DeserializeGiVersionListResult(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(GiVersionData.DeserializeGiVersionData(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 GiVersionListResult(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); + default: + throw new FormatException($"The model {nameof(GiVersionListResult)} does not support writing '{options.Format}' format."); + } + } + + GiVersionListResult 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 DeserializeGiVersionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GiVersionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionListResult.cs new file mode 100644 index 000000000000..c88a2088e6e5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionListResult.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.OracleDatabase.Models +{ + /// The response of a GiVersion list operation. + internal partial class GiVersionListResult + { + /// + /// 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 GiVersion items on this page. + /// is null. + internal GiVersionListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The GiVersion items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal GiVersionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GiVersionListResult() + { + } + + /// The GiVersion items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionProperties.Serialization.cs new file mode 100644 index 000000000000..e0b51d8bba0b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionProperties.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.OracleDatabase.Models +{ + internal partial class GiVersionProperties : 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(GiVersionProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + 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 + } + } + } + + GiVersionProperties 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(GiVersionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGiVersionProperties(document.RootElement, options); + } + + internal static GiVersionProperties DeserializeGiVersionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string version = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GiVersionProperties(version, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GiVersionProperties)} does not support writing '{options.Format}' format."); + } + } + + GiVersionProperties 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 DeserializeGiVersionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GiVersionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionProperties.cs new file mode 100644 index 000000000000..eff4bd992ef6 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GiVersionProperties.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.OracleDatabase.Models +{ + /// GiVersion resource model. + internal partial class GiVersionProperties + { + /// + /// 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 . + /// A valid Oracle Grid Infrastructure (GI) software version. + /// is null. + internal GiVersionProperties(string version) + { + Argument.AssertNotNull(version, nameof(version)); + + Version = version; + } + + /// Initializes a new instance of . + /// A valid Oracle Grid Infrastructure (GI) software version. + /// Keeps track of any properties unknown to the library. + internal GiVersionProperties(string version, IDictionary serializedAdditionalRawData) + { + Version = version; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GiVersionProperties() + { + } + + /// A valid Oracle Grid Infrastructure (GI) software version. + public string Version { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GridImageType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GridImageType.cs new file mode 100644 index 000000000000..9e8c86a38d34 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/GridImageType.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.OracleDatabase.Models +{ + /// GridImageType enum. + public readonly partial struct GridImageType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public GridImageType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReleaseUpdateValue = "ReleaseUpdate"; + private const string CustomImageValue = "CustomImage"; + + /// Release update. + public static GridImageType ReleaseUpdate { get; } = new GridImageType(ReleaseUpdateValue); + /// Custom image. + public static GridImageType CustomImage { get; } = new GridImageType(CustomImageValue); + /// Determines if two values are the same. + public static bool operator ==(GridImageType left, GridImageType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(GridImageType left, GridImageType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator GridImageType(string value) => new GridImageType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is GridImageType other && Equals(other); + /// + public bool Equals(GridImageType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/HardwareType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/HardwareType.cs new file mode 100644 index 000000000000..1738d2c36be3 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/HardwareType.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.OracleDatabase.Models +{ + /// Hardware Type enum. + public readonly partial struct HardwareType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HardwareType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string COMPUTEValue = "COMPUTE"; + private const string CELLValue = "CELL"; + + /// Hardware type is Database Server. + public static HardwareType COMPUTE { get; } = new HardwareType(COMPUTEValue); + /// Hardware type is Storage Server. + public static HardwareType CELL { get; } = new HardwareType(CELLValue); + /// Determines if two values are the same. + public static bool operator ==(HardwareType left, HardwareType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HardwareType left, HardwareType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator HardwareType(string value) => new HardwareType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HardwareType other && Equals(other); + /// + public bool Equals(HardwareType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/HostFormatType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/HostFormatType.cs new file mode 100644 index 000000000000..97a53491ba07 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/HostFormatType.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.OracleDatabase.Models +{ + /// Host format type enum. + public readonly partial struct HostFormatType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HostFormatType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FqdnValue = "Fqdn"; + private const string IPValue = "Ip"; + + /// FQDN format. + public static HostFormatType Fqdn { get; } = new HostFormatType(FqdnValue); + /// IP format. + public static HostFormatType IP { get; } = new HostFormatType(IPValue); + /// Determines if two values are the same. + public static bool operator ==(HostFormatType left, HostFormatType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HostFormatType left, HostFormatType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator HostFormatType(string value) => new HostFormatType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HostFormatType other && Equals(other); + /// + public bool Equals(HostFormatType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Intent.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Intent.cs new file mode 100644 index 000000000000..4cbc5e4037eb --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Intent.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.OracleDatabase.Models +{ + /// Intent enum. + public readonly partial struct Intent : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Intent(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RetainValue = "Retain"; + private const string ResetValue = "Reset"; + + /// Retain intent. + public static Intent Retain { get; } = new Intent(RetainValue); + /// Reset intent. + public static Intent Reset { get; } = new Intent(ResetValue); + /// Determines if two values are the same. + public static bool operator ==(Intent left, Intent right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Intent left, Intent right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Intent(string value) => new Intent(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Intent other && Equals(other); + /// + public bool Equals(Intent 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/IormLifecycleState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/IormLifecycleState.cs new file mode 100644 index 000000000000..9952bb63c49f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/IormLifecycleState.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// ORM lifecycle state enum. + public readonly partial struct IormLifecycleState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IormLifecycleState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BootStrappingValue = "BootStrapping"; + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + private const string UpdatingValue = "Updating"; + private const string FailedValue = "Failed"; + + /// Indicates that resource in Provisioning state. + public static IormLifecycleState BootStrapping { get; } = new IormLifecycleState(BootStrappingValue); + /// Indicates that resource in Enabled state. + public static IormLifecycleState Enabled { get; } = new IormLifecycleState(EnabledValue); + /// Indicates that resource in Disabled state. + public static IormLifecycleState Disabled { get; } = new IormLifecycleState(DisabledValue); + /// Indicates that resource in Updating state. + public static IormLifecycleState Updating { get; } = new IormLifecycleState(UpdatingValue); + /// Indicates that resource in Failed state. + public static IormLifecycleState Failed { get; } = new IormLifecycleState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(IormLifecycleState left, IormLifecycleState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IormLifecycleState left, IormLifecycleState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IormLifecycleState(string value) => new IormLifecycleState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IormLifecycleState other && Equals(other); + /// + public bool Equals(IormLifecycleState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/LicenseModel.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/LicenseModel.cs new file mode 100644 index 000000000000..dccf102bb701 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/LicenseModel.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.OracleDatabase.Models +{ + /// LicenseModel enum. + public readonly partial struct LicenseModel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LicenseModel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LicenseIncludedValue = "LicenseIncluded"; + private const string BringYourOwnLicenseValue = "BringYourOwnLicense"; + + /// License included. + public static LicenseModel LicenseIncluded { get; } = new LicenseModel(LicenseIncludedValue); + /// Bring Your Own License. + public static LicenseModel BringYourOwnLicense { get; } = new LicenseModel(BringYourOwnLicenseValue); + /// Determines if two values are the same. + public static bool operator ==(LicenseModel left, LicenseModel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LicenseModel left, LicenseModel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator LicenseModel(string value) => new LicenseModel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LicenseModel other && Equals(other); + /// + public bool Equals(LicenseModel 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/LongTermBackUpScheduleDetails.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/LongTermBackUpScheduleDetails.Serialization.cs new file mode 100644 index 000000000000..12d6ee4c6f69 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/LongTermBackUpScheduleDetails.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.OracleDatabase.Models +{ + public partial class LongTermBackUpScheduleDetails : 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(LongTermBackUpScheduleDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RepeatCadence)) + { + writer.WritePropertyName("repeatCadence"u8); + writer.WriteStringValue(RepeatCadence.Value.ToString()); + } + if (Optional.IsDefined(TimeOfBackup)) + { + writer.WritePropertyName("timeOfBackup"u8); + writer.WriteStringValue(TimeOfBackup.Value, "O"); + } + if (Optional.IsDefined(RetentionPeriodInDays)) + { + writer.WritePropertyName("retentionPeriodInDays"u8); + writer.WriteNumberValue(RetentionPeriodInDays.Value); + } + if (Optional.IsDefined(IsDisabled)) + { + writer.WritePropertyName("isDisabled"u8); + writer.WriteBooleanValue(IsDisabled.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 + } + } + } + + LongTermBackUpScheduleDetails 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(LongTermBackUpScheduleDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLongTermBackUpScheduleDetails(document.RootElement, options); + } + + internal static LongTermBackUpScheduleDetails DeserializeLongTermBackUpScheduleDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RepeatCadenceType? repeatCadence = default; + DateTimeOffset? timeOfBackup = default; + int? retentionPeriodInDays = default; + bool? isDisabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("repeatCadence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + repeatCadence = new RepeatCadenceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeOfBackup"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeOfBackup = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("retentionPeriodInDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retentionPeriodInDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isDisabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDisabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LongTermBackUpScheduleDetails(repeatCadence, timeOfBackup, retentionPeriodInDays, isDisabled, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(LongTermBackUpScheduleDetails)} does not support writing '{options.Format}' format."); + } + } + + LongTermBackUpScheduleDetails 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 DeserializeLongTermBackUpScheduleDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LongTermBackUpScheduleDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/LongTermBackUpScheduleDetails.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/LongTermBackUpScheduleDetails.cs new file mode 100644 index 000000000000..87c1a3c5fd83 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/LongTermBackUpScheduleDetails.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Details for the long-term backup schedule. + public partial class LongTermBackUpScheduleDetails + { + /// + /// 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 LongTermBackUpScheduleDetails() + { + } + + /// Initializes a new instance of . + /// The frequency of the long-term backup schedule. + /// The timestamp for the long-term backup schedule. For a MONTHLY cadence, months having fewer days than the provided date will have the backup taken on the last day of that month. + /// Retention period, in days, for backups. + /// Indicates if the long-term backup schedule should be deleted. The default value is `FALSE`. + /// Keeps track of any properties unknown to the library. + internal LongTermBackUpScheduleDetails(RepeatCadenceType? repeatCadence, DateTimeOffset? timeOfBackup, int? retentionPeriodInDays, bool? isDisabled, IDictionary serializedAdditionalRawData) + { + RepeatCadence = repeatCadence; + TimeOfBackup = timeOfBackup; + RetentionPeriodInDays = retentionPeriodInDays; + IsDisabled = isDisabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The frequency of the long-term backup schedule. + public RepeatCadenceType? RepeatCadence { get; set; } + /// The timestamp for the long-term backup schedule. For a MONTHLY cadence, months having fewer days than the provided date will have the backup taken on the last day of that month. + public DateTimeOffset? TimeOfBackup { get; set; } + /// Retention period, in days, for backups. + public int? RetentionPeriodInDays { get; set; } + /// Indicates if the long-term backup schedule should be deleted. The default value is `FALSE`. + public bool? IsDisabled { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/MaintenanceWindow.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/MaintenanceWindow.Serialization.cs new file mode 100644 index 000000000000..c54903899a95 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/MaintenanceWindow.Serialization.cs @@ -0,0 +1,319 @@ +// 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.OracleDatabase.Models +{ + public partial class MaintenanceWindow : 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(MaintenanceWindow)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Preference)) + { + writer.WritePropertyName("preference"u8); + writer.WriteStringValue(Preference.Value.ToString()); + } + if (Optional.IsCollectionDefined(Months)) + { + writer.WritePropertyName("months"u8); + writer.WriteStartArray(); + foreach (var item in Months) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(WeeksOfMonth)) + { + writer.WritePropertyName("weeksOfMonth"u8); + writer.WriteStartArray(); + foreach (var item in WeeksOfMonth) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(DaysOfWeek)) + { + writer.WritePropertyName("daysOfWeek"u8); + writer.WriteStartArray(); + foreach (var item in DaysOfWeek) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(HoursOfDay)) + { + writer.WritePropertyName("hoursOfDay"u8); + writer.WriteStartArray(); + foreach (var item in HoursOfDay) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(LeadTimeInWeeks)) + { + writer.WritePropertyName("leadTimeInWeeks"u8); + writer.WriteNumberValue(LeadTimeInWeeks.Value); + } + if (Optional.IsDefined(PatchingMode)) + { + writer.WritePropertyName("patchingMode"u8); + writer.WriteStringValue(PatchingMode.Value.ToString()); + } + if (Optional.IsDefined(CustomActionTimeoutInMins)) + { + writer.WritePropertyName("customActionTimeoutInMins"u8); + writer.WriteNumberValue(CustomActionTimeoutInMins.Value); + } + if (Optional.IsDefined(IsCustomActionTimeoutEnabled)) + { + writer.WritePropertyName("isCustomActionTimeoutEnabled"u8); + writer.WriteBooleanValue(IsCustomActionTimeoutEnabled.Value); + } + if (Optional.IsDefined(IsMonthlyPatchingEnabled)) + { + writer.WritePropertyName("isMonthlyPatchingEnabled"u8); + writer.WriteBooleanValue(IsMonthlyPatchingEnabled.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 + } + } + } + + MaintenanceWindow 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(MaintenanceWindow)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMaintenanceWindow(document.RootElement, options); + } + + internal static MaintenanceWindow DeserializeMaintenanceWindow(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Preference? preference = default; + IList months = default; + IList weeksOfMonth = default; + IList daysOfWeek = default; + IList hoursOfDay = default; + int? leadTimeInWeeks = default; + PatchingMode? patchingMode = default; + int? customActionTimeoutInMins = default; + bool? isCustomActionTimeoutEnabled = default; + bool? isMonthlyPatchingEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("preference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + preference = new Preference(property.Value.GetString()); + continue; + } + if (property.NameEquals("months"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Month.DeserializeMonth(item, options)); + } + months = array; + continue; + } + if (property.NameEquals("weeksOfMonth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + weeksOfMonth = array; + continue; + } + if (property.NameEquals("daysOfWeek"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DayOfWeek.DeserializeDayOfWeek(item, options)); + } + daysOfWeek = array; + continue; + } + if (property.NameEquals("hoursOfDay"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + hoursOfDay = array; + continue; + } + if (property.NameEquals("leadTimeInWeeks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + leadTimeInWeeks = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("patchingMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchingMode = new PatchingMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("customActionTimeoutInMins"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customActionTimeoutInMins = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isCustomActionTimeoutEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isCustomActionTimeoutEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isMonthlyPatchingEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMonthlyPatchingEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MaintenanceWindow( + preference, + months ?? new ChangeTrackingList(), + weeksOfMonth ?? new ChangeTrackingList(), + daysOfWeek ?? new ChangeTrackingList(), + hoursOfDay ?? new ChangeTrackingList(), + leadTimeInWeeks, + patchingMode, + customActionTimeoutInMins, + isCustomActionTimeoutEnabled, + isMonthlyPatchingEnabled, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MaintenanceWindow)} does not support writing '{options.Format}' format."); + } + } + + MaintenanceWindow 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 DeserializeMaintenanceWindow(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MaintenanceWindow)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/MaintenanceWindow.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/MaintenanceWindow.cs new file mode 100644 index 000000000000..00bda7d97765 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/MaintenanceWindow.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.OracleDatabase.Models +{ + /// MaintenanceWindow resource properties. + public partial class MaintenanceWindow + { + /// + /// 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 MaintenanceWindow() + { + Months = new ChangeTrackingList(); + WeeksOfMonth = new ChangeTrackingList(); + DaysOfWeek = new ChangeTrackingList(); + HoursOfDay = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The maintenance window scheduling preference. + /// Months during the year when maintenance should be performed. + /// Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. + /// Days during the week when maintenance should be performed. + /// The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC. + /// Lead time window allows user to set a lead time to prepare for a down time. The lead time is in weeks and valid value is between 1 to 4. + /// Cloud Exadata infrastructure node patching method. + /// Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive). + /// If true, enables the configuration of a custom action timeout (waiting period) between database server patching operations. + /// is Monthly Patching Enabled. + /// Keeps track of any properties unknown to the library. + internal MaintenanceWindow(Preference? preference, IList months, IList weeksOfMonth, IList daysOfWeek, IList hoursOfDay, int? leadTimeInWeeks, PatchingMode? patchingMode, int? customActionTimeoutInMins, bool? isCustomActionTimeoutEnabled, bool? isMonthlyPatchingEnabled, IDictionary serializedAdditionalRawData) + { + Preference = preference; + Months = months; + WeeksOfMonth = weeksOfMonth; + DaysOfWeek = daysOfWeek; + HoursOfDay = hoursOfDay; + LeadTimeInWeeks = leadTimeInWeeks; + PatchingMode = patchingMode; + CustomActionTimeoutInMins = customActionTimeoutInMins; + IsCustomActionTimeoutEnabled = isCustomActionTimeoutEnabled; + IsMonthlyPatchingEnabled = isMonthlyPatchingEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The maintenance window scheduling preference. + public Preference? Preference { get; set; } + /// Months during the year when maintenance should be performed. + public IList Months { get; } + /// Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. + public IList WeeksOfMonth { get; } + /// Days during the week when maintenance should be performed. + public IList DaysOfWeek { get; } + /// The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC. + public IList HoursOfDay { get; } + /// Lead time window allows user to set a lead time to prepare for a down time. The lead time is in weeks and valid value is between 1 to 4. + public int? LeadTimeInWeeks { get; set; } + /// Cloud Exadata infrastructure node patching method. + public PatchingMode? PatchingMode { get; set; } + /// Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive). + public int? CustomActionTimeoutInMins { get; set; } + /// If true, enables the configuration of a custom action timeout (waiting period) between database server patching operations. + public bool? IsCustomActionTimeoutEnabled { get; set; } + /// is Monthly Patching Enabled. + public bool? IsMonthlyPatchingEnabled { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Month.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Month.Serialization.cs new file mode 100644 index 000000000000..8c8f804e786b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Month.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.OracleDatabase.Models +{ + public partial class Month : 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(Month)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.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 + } + } + } + + Month 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(Month)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonth(document.RootElement, options); + } + + internal static Month DeserializeMonth(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MonthName name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = new MonthName(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Month(name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Month)} does not support writing '{options.Format}' format."); + } + } + + Month 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 DeserializeMonth(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Month)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Month.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Month.cs new file mode 100644 index 000000000000..c27fcded6a90 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Month.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Month resource properties. + public partial class Month + { + /// + /// 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 . + /// Name of the month of the year. + public Month(MonthName name) + { + Name = name; + } + + /// Initializes a new instance of . + /// Name of the month of the year. + /// Keeps track of any properties unknown to the library. + internal Month(MonthName name, IDictionary serializedAdditionalRawData) + { + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Month() + { + } + + /// Name of the month of the year. + public MonthName Name { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/MonthName.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/MonthName.cs new file mode 100644 index 000000000000..ed4fa2181db9 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/MonthName.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// MonthName enum. + public readonly partial struct MonthName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MonthName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string JanuaryValue = "January"; + private const string FebruaryValue = "February"; + private const string MarchValue = "March"; + private const string AprilValue = "April"; + private const string MayValue = "May"; + private const string JuneValue = "June"; + private const string JulyValue = "July"; + private const string AugustValue = "August"; + private const string SeptemberValue = "September"; + private const string OctoberValue = "October"; + private const string NovemberValue = "November"; + private const string DecemberValue = "December"; + + /// January value. + public static MonthName January { get; } = new MonthName(JanuaryValue); + /// February value. + public static MonthName February { get; } = new MonthName(FebruaryValue); + /// March value. + public static MonthName March { get; } = new MonthName(MarchValue); + /// April value. + public static MonthName April { get; } = new MonthName(AprilValue); + /// May value. + public static MonthName May { get; } = new MonthName(MayValue); + /// June value. + public static MonthName June { get; } = new MonthName(JuneValue); + /// July value. + public static MonthName July { get; } = new MonthName(JulyValue); + /// August value. + public static MonthName August { get; } = new MonthName(AugustValue); + /// September value. + public static MonthName September { get; } = new MonthName(SeptemberValue); + /// October value. + public static MonthName October { get; } = new MonthName(OctoberValue); + /// November value. + public static MonthName November { get; } = new MonthName(NovemberValue); + /// December value. + public static MonthName December { get; } = new MonthName(DecemberValue); + /// Determines if two values are the same. + public static bool operator ==(MonthName left, MonthName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MonthName left, MonthName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MonthName(string value) => new MonthName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MonthName other && Equals(other); + /// + public bool Equals(MonthName 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/NsgCidr.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/NsgCidr.Serialization.cs new file mode 100644 index 000000000000..536b7285465a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/NsgCidr.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.OracleDatabase.Models +{ + public partial class NsgCidr : 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(NsgCidr)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + if (Optional.IsDefined(DestinationPortRange)) + { + writer.WritePropertyName("destinationPortRange"u8); + writer.WriteObjectValue(DestinationPortRange, 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 + } + } + } + + NsgCidr 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(NsgCidr)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNsgCidr(document.RootElement, options); + } + + internal static NsgCidr DeserializeNsgCidr(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string source = default; + PortRange destinationPortRange = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("destinationPortRange"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + destinationPortRange = PortRange.DeserializePortRange(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NsgCidr(source, destinationPortRange, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NsgCidr)} does not support writing '{options.Format}' format."); + } + } + + NsgCidr 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 DeserializeNsgCidr(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NsgCidr)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/NsgCidr.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/NsgCidr.cs new file mode 100644 index 000000000000..d2a11d478748 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/NsgCidr.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.OracleDatabase.Models +{ + /// A rule for allowing inbound (INGRESS) IP packets. + public partial class NsgCidr + { + /// + /// 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 . + /// Conceptually, this is the range of IP addresses that a packet coming into the instance can come from. + /// is null. + public NsgCidr(string source) + { + Argument.AssertNotNull(source, nameof(source)); + + Source = source; + } + + /// Initializes a new instance of . + /// Conceptually, this is the range of IP addresses that a packet coming into the instance can come from. + /// Destination port range to specify particular destination ports for TCP rules. + /// Keeps track of any properties unknown to the library. + internal NsgCidr(string source, PortRange destinationPortRange, IDictionary serializedAdditionalRawData) + { + Source = source; + DestinationPortRange = destinationPortRange; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NsgCidr() + { + } + + /// Conceptually, this is the range of IP addresses that a packet coming into the instance can come from. + public string Source { get; set; } + /// Destination port range to specify particular destination ports for TCP rules. + public PortRange DestinationPortRange { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Objective.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Objective.cs new file mode 100644 index 000000000000..ba24d746b643 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Objective.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Objective enum. + public readonly partial struct Objective : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Objective(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LowLatencyValue = "LowLatency"; + private const string HighThroughputValue = "HighThroughput"; + private const string BalancedValue = "Balanced"; + private const string AutoValue = "Auto"; + private const string BasicValue = "Basic"; + + /// Low latency objective. + public static Objective LowLatency { get; } = new Objective(LowLatencyValue); + /// High throughput objective. + public static Objective HighThroughput { get; } = new Objective(HighThroughputValue); + /// Balanced objective. + public static Objective Balanced { get; } = new Objective(BalancedValue); + /// Auto objective. + public static Objective Auto { get; } = new Objective(AutoValue); + /// Basic objective. + public static Objective Basic { get; } = new Objective(BasicValue); + /// Determines if two values are the same. + public static bool operator ==(Objective left, Objective right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Objective left, Objective right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Objective(string value) => new Objective(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Objective other && Equals(other); + /// + public bool Equals(Objective 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OpenModeType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OpenModeType.cs new file mode 100644 index 000000000000..6b99e34c07db --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OpenModeType.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.OracleDatabase.Models +{ + /// Open mode type enum. + public readonly partial struct OpenModeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OpenModeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReadOnlyValue = "ReadOnly"; + private const string ReadWriteValue = "ReadWrite"; + + /// ReadOnly mode. + public static OpenModeType ReadOnly { get; } = new OpenModeType(ReadOnlyValue); + /// ReadWrite mode. + public static OpenModeType ReadWrite { get; } = new OpenModeType(ReadWriteValue); + /// Determines if two values are the same. + public static bool operator ==(OpenModeType left, OpenModeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OpenModeType left, OpenModeType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OpenModeType(string value) => new OpenModeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OpenModeType other && Equals(other); + /// + public bool Equals(OpenModeType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OperationsInsightsStatusType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OperationsInsightsStatusType.cs new file mode 100644 index 000000000000..dad1a19278d5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OperationsInsightsStatusType.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.OracleDatabase.Models +{ + /// Operations Insights status type enum. + public readonly partial struct OperationsInsightsStatusType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OperationsInsightsStatusType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnablingValue = "Enabling"; + private const string EnabledValue = "Enabled"; + private const string DisablingValue = "Disabling"; + private const string NotEnabledValue = "NotEnabled"; + private const string FailedEnablingValue = "FailedEnabling"; + private const string FailedDisablingValue = "FailedDisabling"; + + /// Enabling status. + public static OperationsInsightsStatusType Enabling { get; } = new OperationsInsightsStatusType(EnablingValue); + /// Enabled status. + public static OperationsInsightsStatusType Enabled { get; } = new OperationsInsightsStatusType(EnabledValue); + /// Disabling status. + public static OperationsInsightsStatusType Disabling { get; } = new OperationsInsightsStatusType(DisablingValue); + /// NotEnabled status. + public static OperationsInsightsStatusType NotEnabled { get; } = new OperationsInsightsStatusType(NotEnabledValue); + /// FailedEnabling status. + public static OperationsInsightsStatusType FailedEnabling { get; } = new OperationsInsightsStatusType(FailedEnablingValue); + /// FailedDisabling status. + public static OperationsInsightsStatusType FailedDisabling { get; } = new OperationsInsightsStatusType(FailedDisablingValue); + /// Determines if two values are the same. + public static bool operator ==(OperationsInsightsStatusType left, OperationsInsightsStatusType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OperationsInsightsStatusType left, OperationsInsightsStatusType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OperationsInsightsStatusType(string value) => new OperationsInsightsStatusType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OperationsInsightsStatusType other && Equals(other); + /// + public bool Equals(OperationsInsightsStatusType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionListResult.Serialization.cs new file mode 100644 index 000000000000..f09dd5899db9 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionListResult.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.OracleDatabase.Models +{ + internal partial class OracleSubscriptionListResult : 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(OracleSubscriptionListResult)} 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 + } + } + } + + OracleSubscriptionListResult 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(OracleSubscriptionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOracleSubscriptionListResult(document.RootElement, options); + } + + internal static OracleSubscriptionListResult DeserializeOracleSubscriptionListResult(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(OracleSubscriptionData.DeserializeOracleSubscriptionData(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 OracleSubscriptionListResult(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); + default: + throw new FormatException($"The model {nameof(OracleSubscriptionListResult)} does not support writing '{options.Format}' format."); + } + } + + OracleSubscriptionListResult 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 DeserializeOracleSubscriptionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OracleSubscriptionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionListResult.cs new file mode 100644 index 000000000000..275e5e85d114 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionListResult.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.OracleDatabase.Models +{ + /// The response of a OracleSubscription list operation. + internal partial class OracleSubscriptionListResult + { + /// + /// 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 OracleSubscription items on this page. + /// is null. + internal OracleSubscriptionListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The OracleSubscription items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal OracleSubscriptionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OracleSubscriptionListResult() + { + } + + /// The OracleSubscription items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionPatch.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionPatch.Serialization.cs new file mode 100644 index 000000000000..d9f3908329a6 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionPatch.Serialization.cs @@ -0,0 +1,149 @@ +// 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.OracleDatabase.Models +{ + public partial class OracleSubscriptionPatch : 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(OracleSubscriptionPatch)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Plan)) + { + writer.WritePropertyName("plan"u8); + JsonSerializer.Serialize(writer, Plan); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OracleSubscriptionPatch 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(OracleSubscriptionPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOracleSubscriptionPatch(document.RootElement, options); + } + + internal static OracleSubscriptionPatch DeserializeOracleSubscriptionPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ArmPlan plan = default; + OracleSubscriptionUpdateProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("plan"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + plan = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = OracleSubscriptionUpdateProperties.DeserializeOracleSubscriptionUpdateProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OracleSubscriptionPatch(plan, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OracleSubscriptionPatch)} does not support writing '{options.Format}' format."); + } + } + + OracleSubscriptionPatch 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 DeserializeOracleSubscriptionPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OracleSubscriptionPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionPatch.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionPatch.cs new file mode 100644 index 000000000000..0c3c8e379f39 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionPatch.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.ResourceManager.Models; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// The type used for update operations of the OracleSubscription. + public partial class OracleSubscriptionPatch + { + /// + /// 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 OracleSubscriptionPatch() + { + } + + /// Initializes a new instance of . + /// Details of the resource plan. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal OracleSubscriptionPatch(ArmPlan plan, OracleSubscriptionUpdateProperties properties, IDictionary serializedAdditionalRawData) + { + Plan = plan; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Details of the resource plan. + public ArmPlan Plan { get; set; } + /// The resource-specific properties for this resource. + public OracleSubscriptionUpdateProperties Properties { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.Serialization.cs new file mode 100644 index 000000000000..a4af2ef3d686 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.Serialization.cs @@ -0,0 +1,269 @@ +// 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.OracleDatabase.Models +{ + public partial class OracleSubscriptionProperties : 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(OracleSubscriptionProperties)} 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(SaasSubscriptionId)) + { + writer.WritePropertyName("saasSubscriptionId"u8); + writer.WriteStringValue(SaasSubscriptionId); + } + if (options.Format != "W" && Optional.IsDefined(CloudAccountId)) + { + writer.WritePropertyName("cloudAccountId"u8); + writer.WriteStringValue(CloudAccountId); + } + if (options.Format != "W" && Optional.IsDefined(CloudAccountState)) + { + writer.WritePropertyName("cloudAccountState"u8); + writer.WriteStringValue(CloudAccountState.Value.ToString()); + } + if (Optional.IsDefined(TermUnit)) + { + writer.WritePropertyName("termUnit"u8); + writer.WriteStringValue(TermUnit); + } + if (Optional.IsDefined(ProductCode)) + { + writer.WritePropertyName("productCode"u8); + writer.WriteStringValue(ProductCode); + } + if (Optional.IsDefined(Intent)) + { + writer.WritePropertyName("intent"u8); + writer.WriteStringValue(Intent.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AzureSubscriptionIds)) + { + writer.WritePropertyName("azureSubscriptionIds"u8); + writer.WriteStartArray(); + foreach (var item in AzureSubscriptionIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(AddSubscriptionOperationState)) + { + writer.WritePropertyName("addSubscriptionOperationState"u8); + writer.WriteStringValue(AddSubscriptionOperationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LastOperationStatusDetail)) + { + writer.WritePropertyName("lastOperationStatusDetail"u8); + writer.WriteStringValue(LastOperationStatusDetail); + } + 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 + } + } + } + + OracleSubscriptionProperties 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(OracleSubscriptionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOracleSubscriptionProperties(document.RootElement, options); + } + + internal static OracleSubscriptionProperties DeserializeOracleSubscriptionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OracleSubscriptionProvisioningState? provisioningState = default; + string saasSubscriptionId = default; + string cloudAccountId = default; + CloudAccountProvisioningState? cloudAccountState = default; + string termUnit = default; + string productCode = default; + Intent? intent = default; + IReadOnlyList azureSubscriptionIds = default; + AddSubscriptionOperationState? addSubscriptionOperationState = default; + string lastOperationStatusDetail = 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 OracleSubscriptionProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("saasSubscriptionId"u8)) + { + saasSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("cloudAccountId"u8)) + { + cloudAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("cloudAccountState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cloudAccountState = new CloudAccountProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("termUnit"u8)) + { + termUnit = property.Value.GetString(); + continue; + } + if (property.NameEquals("productCode"u8)) + { + productCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("intent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + intent = new Intent(property.Value.GetString()); + continue; + } + if (property.NameEquals("azureSubscriptionIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + azureSubscriptionIds = array; + continue; + } + if (property.NameEquals("addSubscriptionOperationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + addSubscriptionOperationState = new AddSubscriptionOperationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lastOperationStatusDetail"u8)) + { + lastOperationStatusDetail = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OracleSubscriptionProperties( + provisioningState, + saasSubscriptionId, + cloudAccountId, + cloudAccountState, + termUnit, + productCode, + intent, + azureSubscriptionIds ?? new ChangeTrackingList(), + addSubscriptionOperationState, + lastOperationStatusDetail, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OracleSubscriptionProperties)} does not support writing '{options.Format}' format."); + } + } + + OracleSubscriptionProperties 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 DeserializeOracleSubscriptionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OracleSubscriptionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.cs new file mode 100644 index 000000000000..51ba008b2137 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProperties.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.OracleDatabase.Models +{ + /// Oracle Subscription resource model. + public partial class OracleSubscriptionProperties + { + /// + /// 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 OracleSubscriptionProperties() + { + AzureSubscriptionIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// OracleSubscriptionProvisioningState provisioning state. + /// SAAS subscription ID generated by Marketplace. + /// Cloud Account Id. + /// Cloud Account provisioning state. + /// Term Unit. P1Y, P3Y, etc, see Durations https://en.wikipedia.org/wiki/ISO_8601. + /// Product code for the term unit. + /// Intent for the update operation. + /// Azure subscriptions to be added. + /// State of the add Azure subscription operation on Oracle subscription. + /// Status details of the last operation on Oracle subscription. + /// Keeps track of any properties unknown to the library. + internal OracleSubscriptionProperties(OracleSubscriptionProvisioningState? provisioningState, string saasSubscriptionId, string cloudAccountId, CloudAccountProvisioningState? cloudAccountState, string termUnit, string productCode, Intent? intent, IReadOnlyList azureSubscriptionIds, AddSubscriptionOperationState? addSubscriptionOperationState, string lastOperationStatusDetail, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + SaasSubscriptionId = saasSubscriptionId; + CloudAccountId = cloudAccountId; + CloudAccountState = cloudAccountState; + TermUnit = termUnit; + ProductCode = productCode; + Intent = intent; + AzureSubscriptionIds = azureSubscriptionIds; + AddSubscriptionOperationState = addSubscriptionOperationState; + LastOperationStatusDetail = lastOperationStatusDetail; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// OracleSubscriptionProvisioningState provisioning state. + public OracleSubscriptionProvisioningState? ProvisioningState { get; } + /// SAAS subscription ID generated by Marketplace. + public string SaasSubscriptionId { get; } + /// Cloud Account Id. + public string CloudAccountId { get; } + /// Cloud Account provisioning state. + public CloudAccountProvisioningState? CloudAccountState { get; } + /// Term Unit. P1Y, P3Y, etc, see Durations https://en.wikipedia.org/wiki/ISO_8601. + public string TermUnit { get; set; } + /// Product code for the term unit. + public string ProductCode { get; set; } + /// Intent for the update operation. + public Intent? Intent { get; set; } + /// Azure subscriptions to be added. + public IReadOnlyList AzureSubscriptionIds { get; } + /// State of the add Azure subscription operation on Oracle subscription. + public AddSubscriptionOperationState? AddSubscriptionOperationState { get; } + /// Status details of the last operation on Oracle subscription. + public string LastOperationStatusDetail { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProvisioningState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProvisioningState.cs new file mode 100644 index 000000000000..83c1766bbdf0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionProvisioningState.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.OracleDatabase.Models +{ + /// OracleSubscriptionProvisioningState enum. + public readonly partial struct OracleSubscriptionProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OracleSubscriptionProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Resource has been created. + public static OracleSubscriptionProvisioningState Succeeded { get; } = new OracleSubscriptionProvisioningState(SucceededValue); + /// Resource creation failed. + public static OracleSubscriptionProvisioningState Failed { get; } = new OracleSubscriptionProvisioningState(FailedValue); + /// Resource creation was canceled. + public static OracleSubscriptionProvisioningState Canceled { get; } = new OracleSubscriptionProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(OracleSubscriptionProvisioningState left, OracleSubscriptionProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OracleSubscriptionProvisioningState left, OracleSubscriptionProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OracleSubscriptionProvisioningState(string value) => new OracleSubscriptionProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OracleSubscriptionProvisioningState other && Equals(other); + /// + public bool Equals(OracleSubscriptionProvisioningState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionUpdateProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionUpdateProperties.Serialization.cs new file mode 100644 index 000000000000..6737c9ad3aa6 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionUpdateProperties.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.OracleDatabase.Models +{ + public partial class OracleSubscriptionUpdateProperties : 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(OracleSubscriptionUpdateProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ProductCode)) + { + writer.WritePropertyName("productCode"u8); + writer.WriteStringValue(ProductCode); + } + if (Optional.IsDefined(Intent)) + { + writer.WritePropertyName("intent"u8); + writer.WriteStringValue(Intent.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 + } + } + } + + OracleSubscriptionUpdateProperties 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(OracleSubscriptionUpdateProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOracleSubscriptionUpdateProperties(document.RootElement, options); + } + + internal static OracleSubscriptionUpdateProperties DeserializeOracleSubscriptionUpdateProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string productCode = default; + Intent? intent = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("productCode"u8)) + { + productCode = property.Value.GetString(); + continue; + } + if (property.NameEquals("intent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + intent = new Intent(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OracleSubscriptionUpdateProperties(productCode, intent, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OracleSubscriptionUpdateProperties)} does not support writing '{options.Format}' format."); + } + } + + OracleSubscriptionUpdateProperties 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 DeserializeOracleSubscriptionUpdateProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OracleSubscriptionUpdateProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionUpdateProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionUpdateProperties.cs new file mode 100644 index 000000000000..88f35c583f30 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/OracleSubscriptionUpdateProperties.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.OracleDatabase.Models +{ + /// The updatable properties of the OracleSubscription. + public partial class OracleSubscriptionUpdateProperties + { + /// + /// 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 OracleSubscriptionUpdateProperties() + { + } + + /// Initializes a new instance of . + /// Product code for the term unit. + /// Intent for the update operation. + /// Keeps track of any properties unknown to the library. + internal OracleSubscriptionUpdateProperties(string productCode, Intent? intent, IDictionary serializedAdditionalRawData) + { + ProductCode = productCode; + Intent = intent; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Product code for the term unit. + public string ProductCode { get; set; } + /// Intent for the update operation. + public Intent? Intent { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PatchingMode.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PatchingMode.cs new file mode 100644 index 000000000000..87ef8dcf4f40 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PatchingMode.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.OracleDatabase.Models +{ + /// Patching mode enum. + public readonly partial struct PatchingMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PatchingMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RollingValue = "Rolling"; + private const string NonRollingValue = "NonRolling"; + + /// Rolling patching. + public static PatchingMode Rolling { get; } = new PatchingMode(RollingValue); + /// Non Rolling patching. + public static PatchingMode NonRolling { get; } = new PatchingMode(NonRollingValue); + /// Determines if two values are the same. + public static bool operator ==(PatchingMode left, PatchingMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PatchingMode left, PatchingMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PatchingMode(string value) => new PatchingMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatchingMode other && Equals(other); + /// + public bool Equals(PatchingMode 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PeerDbDetails.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PeerDbDetails.Serialization.cs new file mode 100644 index 000000000000..789909a5fe0e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PeerDbDetails.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.OracleDatabase.Models +{ + public partial class PeerDbDetails : 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(PeerDbDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PeerDbId)) + { + writer.WritePropertyName("peerDbId"u8); + writer.WriteStringValue(PeerDbId); + } + if (Optional.IsDefined(PeerDbOcid)) + { + writer.WritePropertyName("peerDbOcid"u8); + writer.WriteStringValue(PeerDbOcid); + } + if (Optional.IsDefined(PeerDbLocation)) + { + writer.WritePropertyName("peerDbLocation"u8); + writer.WriteStringValue(PeerDbLocation); + } + 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 + } + } + } + + PeerDbDetails 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(PeerDbDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePeerDbDetails(document.RootElement, options); + } + + internal static PeerDbDetails DeserializePeerDbDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string peerDbId = default; + string peerDbOcid = default; + string peerDbLocation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("peerDbId"u8)) + { + peerDbId = property.Value.GetString(); + continue; + } + if (property.NameEquals("peerDbOcid"u8)) + { + peerDbOcid = property.Value.GetString(); + continue; + } + if (property.NameEquals("peerDbLocation"u8)) + { + peerDbLocation = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PeerDbDetails(peerDbId, peerDbOcid, peerDbLocation, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PeerDbDetails)} does not support writing '{options.Format}' format."); + } + } + + PeerDbDetails 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 DeserializePeerDbDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PeerDbDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PeerDbDetails.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PeerDbDetails.cs new file mode 100644 index 000000000000..d05c7147d2ed --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PeerDbDetails.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.OracleDatabase.Models +{ + /// PeerDb Details. + public partial class PeerDbDetails + { + /// + /// 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 PeerDbDetails() + { + } + + /// Initializes a new instance of . + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Ocid of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// The location of the Disaster Recovery peer database. + /// Keeps track of any properties unknown to the library. + internal PeerDbDetails(string peerDbId, string peerDbOcid, string peerDbLocation, IDictionary serializedAdditionalRawData) + { + PeerDbId = peerDbId; + PeerDbOcid = peerDbOcid; + PeerDbLocation = peerDbLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + public string PeerDbId { get; set; } + /// Ocid of the Disaster Recovery peer database, which is located in a different region from the current peer database. + public string PeerDbOcid { get; set; } + /// The location of the Disaster Recovery peer database. + public string PeerDbLocation { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PermissionLevelType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PermissionLevelType.cs new file mode 100644 index 000000000000..b71a62d48064 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PermissionLevelType.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.OracleDatabase.Models +{ + /// Permission level type enum. + public readonly partial struct PermissionLevelType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PermissionLevelType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RestrictedValue = "Restricted"; + private const string UnrestrictedValue = "Unrestricted"; + + /// Restricted permission level. + public static PermissionLevelType Restricted { get; } = new PermissionLevelType(RestrictedValue); + /// Unrestricted permission level. + public static PermissionLevelType Unrestricted { get; } = new PermissionLevelType(UnrestrictedValue); + /// Determines if two values are the same. + public static bool operator ==(PermissionLevelType left, PermissionLevelType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PermissionLevelType left, PermissionLevelType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PermissionLevelType(string value) => new PermissionLevelType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PermissionLevelType other && Equals(other); + /// + public bool Equals(PermissionLevelType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PortRange.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PortRange.Serialization.cs new file mode 100644 index 000000000000..1d95a6e6b8db --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PortRange.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.OracleDatabase.Models +{ + public partial class PortRange : 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(PortRange)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("min"u8); + writer.WriteNumberValue(Min); + writer.WritePropertyName("max"u8); + writer.WriteNumberValue(Max); + 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 + } + } + } + + PortRange 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(PortRange)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePortRange(document.RootElement, options); + } + + internal static PortRange DeserializePortRange(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int min = default; + int max = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("min"u8)) + { + min = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("max"u8)) + { + max = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PortRange(min, max, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PortRange)} does not support writing '{options.Format}' format."); + } + } + + PortRange 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 DeserializePortRange(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PortRange)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PortRange.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PortRange.cs new file mode 100644 index 000000000000..9da88a20ae1c --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PortRange.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Port Range to specify particular destination ports for TCP rules. + public partial class PortRange + { + /// + /// 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 minimum port number, which must not be greater than the maximum port number. + /// The maximum port number, which must not be less than the minimum port number. To specify a single port number, set both the min and max to the same value. + public PortRange(int min, int max) + { + Min = min; + Max = max; + } + + /// Initializes a new instance of . + /// The minimum port number, which must not be greater than the maximum port number. + /// The maximum port number, which must not be less than the minimum port number. To specify a single port number, set both the min and max to the same value. + /// Keeps track of any properties unknown to the library. + internal PortRange(int min, int max, IDictionary serializedAdditionalRawData) + { + Min = min; + Max = max; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PortRange() + { + } + + /// The minimum port number, which must not be greater than the maximum port number. + public int Min { get; set; } + /// The maximum port number, which must not be less than the minimum port number. To specify a single port number, set both the min and max to the same value. + public int Max { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Preference.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Preference.cs new file mode 100644 index 000000000000..034ba87a8a72 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/Preference.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.OracleDatabase.Models +{ + /// Preference enum. + public readonly partial struct Preference : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Preference(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoPreferenceValue = "NoPreference"; + private const string CustomPreferenceValue = "CustomPreference"; + + /// No preference. + public static Preference NoPreference { get; } = new Preference(NoPreferenceValue); + /// Custom preference. + public static Preference CustomPreference { get; } = new Preference(CustomPreferenceValue); + /// Determines if two values are the same. + public static bool operator ==(Preference left, Preference right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Preference left, Preference right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Preference(string value) => new Preference(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Preference other && Equals(other); + /// + public bool Equals(Preference 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressProperties.Serialization.cs new file mode 100644 index 000000000000..de2b2fecb136 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressProperties.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.OracleDatabase.Models +{ + public partial class PrivateIPAddressProperties : 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(PrivateIPAddressProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + writer.WritePropertyName("hostnameLabel"u8); + writer.WriteStringValue(HostnameLabel); + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + writer.WritePropertyName("ipAddress"u8); + writer.WriteStringValue(IPAddress); + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + 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 + } + } + } + + PrivateIPAddressProperties 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(PrivateIPAddressProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrivateIPAddressProperties(document.RootElement, options); + } + + internal static PrivateIPAddressProperties DeserializePrivateIPAddressProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string displayName = default; + string hostnameLabel = default; + string ocid = default; + string ipAddress = default; + string subnetId = 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("hostnameLabel"u8)) + { + hostnameLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + subnetId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrivateIPAddressProperties( + displayName, + hostnameLabel, + ocid, + ipAddress, + subnetId, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PrivateIPAddressProperties)} does not support writing '{options.Format}' format."); + } + } + + PrivateIPAddressProperties 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 DeserializePrivateIPAddressProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrivateIPAddressProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressProperties.cs new file mode 100644 index 000000000000..afee8e448c0f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressProperties.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.OracleDatabase.Models +{ + /// PrivateIpAddress resource properties. + public partial class PrivateIPAddressProperties + { + /// + /// 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 . + /// PrivateIpAddresses displayName. + /// PrivateIpAddresses hostnameLabel. + /// PrivateIpAddresses Id. + /// PrivateIpAddresses ipAddress. + /// PrivateIpAddresses subnetId. + /// , , , or is null. + internal PrivateIPAddressProperties(string displayName, string hostnameLabel, string ocid, string ipAddress, string subnetId) + { + Argument.AssertNotNull(displayName, nameof(displayName)); + Argument.AssertNotNull(hostnameLabel, nameof(hostnameLabel)); + Argument.AssertNotNull(ocid, nameof(ocid)); + Argument.AssertNotNull(ipAddress, nameof(ipAddress)); + Argument.AssertNotNull(subnetId, nameof(subnetId)); + + DisplayName = displayName; + HostnameLabel = hostnameLabel; + Ocid = ocid; + IPAddress = ipAddress; + SubnetId = subnetId; + } + + /// Initializes a new instance of . + /// PrivateIpAddresses displayName. + /// PrivateIpAddresses hostnameLabel. + /// PrivateIpAddresses Id. + /// PrivateIpAddresses ipAddress. + /// PrivateIpAddresses subnetId. + /// Keeps track of any properties unknown to the library. + internal PrivateIPAddressProperties(string displayName, string hostnameLabel, string ocid, string ipAddress, string subnetId, IDictionary serializedAdditionalRawData) + { + DisplayName = displayName; + HostnameLabel = hostnameLabel; + Ocid = ocid; + IPAddress = ipAddress; + SubnetId = subnetId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PrivateIPAddressProperties() + { + } + + /// PrivateIpAddresses displayName. + public string DisplayName { get; } + /// PrivateIpAddresses hostnameLabel. + public string HostnameLabel { get; } + /// PrivateIpAddresses Id. + public string Ocid { get; } + /// PrivateIpAddresses ipAddress. + public string IPAddress { get; } + /// PrivateIpAddresses subnetId. + public string SubnetId { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressesFilter.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressesFilter.Serialization.cs new file mode 100644 index 000000000000..a9f1ead448cd --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressesFilter.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.OracleDatabase.Models +{ + public partial class PrivateIPAddressesFilter : 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(PrivateIPAddressesFilter)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + writer.WritePropertyName("vnicId"u8); + writer.WriteStringValue(VnicId); + 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 + } + } + } + + PrivateIPAddressesFilter 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(PrivateIPAddressesFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrivateIPAddressesFilter(document.RootElement, options); + } + + internal static PrivateIPAddressesFilter DeserializePrivateIPAddressesFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string subnetId = default; + string vnicId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subnetId"u8)) + { + subnetId = property.Value.GetString(); + continue; + } + if (property.NameEquals("vnicId"u8)) + { + vnicId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrivateIPAddressesFilter(subnetId, vnicId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PrivateIPAddressesFilter)} does not support writing '{options.Format}' format."); + } + } + + PrivateIPAddressesFilter 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 DeserializePrivateIPAddressesFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrivateIPAddressesFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressesFilter.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressesFilter.cs new file mode 100644 index 000000000000..971d461f81e5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/PrivateIPAddressesFilter.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.OracleDatabase.Models +{ + /// Private Ip Addresses filter. + public partial class PrivateIPAddressesFilter + { + /// + /// 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 . + /// Subnet OCID. + /// VCN OCID. + /// or is null. + public PrivateIPAddressesFilter(string subnetId, string vnicId) + { + Argument.AssertNotNull(subnetId, nameof(subnetId)); + Argument.AssertNotNull(vnicId, nameof(vnicId)); + + SubnetId = subnetId; + VnicId = vnicId; + } + + /// Initializes a new instance of . + /// Subnet OCID. + /// VCN OCID. + /// Keeps track of any properties unknown to the library. + internal PrivateIPAddressesFilter(string subnetId, string vnicId, IDictionary serializedAdditionalRawData) + { + SubnetId = subnetId; + VnicId = vnicId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PrivateIPAddressesFilter() + { + } + + /// Subnet OCID. + public string SubnetId { get; } + /// VCN OCID. + public string VnicId { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ProfileType.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ProfileType.Serialization.cs new file mode 100644 index 000000000000..8446b30b967a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ProfileType.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.OracleDatabase.Models +{ + public partial class ProfileType : 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(ProfileType)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ConsumerGroup)) + { + writer.WritePropertyName("consumerGroup"u8); + writer.WriteStringValue(ConsumerGroup.Value.ToString()); + } + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + writer.WritePropertyName("hostFormat"u8); + writer.WriteStringValue(HostFormat.ToString()); + if (Optional.IsDefined(IsRegional)) + { + writer.WritePropertyName("isRegional"u8); + writer.WriteBooleanValue(IsRegional.Value); + } + writer.WritePropertyName("protocol"u8); + writer.WriteStringValue(Protocol.ToString()); + writer.WritePropertyName("sessionMode"u8); + writer.WriteStringValue(SessionMode.ToString()); + writer.WritePropertyName("syntaxFormat"u8); + writer.WriteStringValue(SyntaxFormat.ToString()); + if (Optional.IsDefined(TlsAuthentication)) + { + writer.WritePropertyName("tlsAuthentication"u8); + writer.WriteStringValue(TlsAuthentication.Value.ToString()); + } + writer.WritePropertyName("value"u8); + writer.WriteStringValue(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 + } + } + } + + ProfileType 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(ProfileType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProfileType(document.RootElement, options); + } + + internal static ProfileType DeserializeProfileType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConsumerGroup? consumerGroup = default; + string displayName = default; + HostFormatType hostFormat = default; + bool? isRegional = default; + ProtocolType protocol = default; + SessionModeType sessionMode = default; + SyntaxFormatType syntaxFormat = default; + TlsAuthenticationType? tlsAuthentication = default; + string value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("consumerGroup"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + consumerGroup = new ConsumerGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostFormat"u8)) + { + hostFormat = new HostFormatType(property.Value.GetString()); + continue; + } + if (property.NameEquals("isRegional"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isRegional = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("protocol"u8)) + { + protocol = new ProtocolType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sessionMode"u8)) + { + sessionMode = new SessionModeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("syntaxFormat"u8)) + { + syntaxFormat = new SyntaxFormatType(property.Value.GetString()); + continue; + } + if (property.NameEquals("tlsAuthentication"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tlsAuthentication = new TlsAuthenticationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProfileType( + consumerGroup, + displayName, + hostFormat, + isRegional, + protocol, + sessionMode, + syntaxFormat, + tlsAuthentication, + value, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProfileType)} does not support writing '{options.Format}' format."); + } + } + + ProfileType 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 DeserializeProfileType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProfileType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ProfileType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ProfileType.cs new file mode 100644 index 000000000000..dbb9165860dd --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ProfileType.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; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// The connection string profile to allow clients to group, filter and select connection string values based on structured metadata. + public partial class ProfileType + { + /// + /// 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 . + /// A user-friendly name for the connection. + /// Host format used in connection string. + /// Protocol used by the connection. + /// Specifies whether the listener performs a direct hand-off of the session, or redirects the session. + /// Specifies whether the connection string is using the long (LONG), Easy Connect (EZCONNECT), or Easy Connect Plus (EZCONNECTPLUS) format. + /// Connection string value. + /// or is null. + internal ProfileType(string displayName, HostFormatType hostFormat, ProtocolType protocol, SessionModeType sessionMode, SyntaxFormatType syntaxFormat, string value) + { + Argument.AssertNotNull(displayName, nameof(displayName)); + Argument.AssertNotNull(value, nameof(value)); + + DisplayName = displayName; + HostFormat = hostFormat; + Protocol = protocol; + SessionMode = sessionMode; + SyntaxFormat = syntaxFormat; + Value = value; + } + + /// Initializes a new instance of . + /// Consumer group used by the connection. + /// A user-friendly name for the connection. + /// Host format used in connection string. + /// True for a regional connection string, applicable to cross-region DG only. + /// Protocol used by the connection. + /// Specifies whether the listener performs a direct hand-off of the session, or redirects the session. + /// Specifies whether the connection string is using the long (LONG), Easy Connect (EZCONNECT), or Easy Connect Plus (EZCONNECTPLUS) format. + /// Specifies whether the TLS handshake is using one-way (SERVER) or mutual (MUTUAL) authentication. + /// Connection string value. + /// Keeps track of any properties unknown to the library. + internal ProfileType(ConsumerGroup? consumerGroup, string displayName, HostFormatType hostFormat, bool? isRegional, ProtocolType protocol, SessionModeType sessionMode, SyntaxFormatType syntaxFormat, TlsAuthenticationType? tlsAuthentication, string value, IDictionary serializedAdditionalRawData) + { + ConsumerGroup = consumerGroup; + DisplayName = displayName; + HostFormat = hostFormat; + IsRegional = isRegional; + Protocol = protocol; + SessionMode = sessionMode; + SyntaxFormat = syntaxFormat; + TlsAuthentication = tlsAuthentication; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProfileType() + { + } + + /// Consumer group used by the connection. + public ConsumerGroup? ConsumerGroup { get; } + /// A user-friendly name for the connection. + public string DisplayName { get; } + /// Host format used in connection string. + public HostFormatType HostFormat { get; } + /// True for a regional connection string, applicable to cross-region DG only. + public bool? IsRegional { get; } + /// Protocol used by the connection. + public ProtocolType Protocol { get; } + /// Specifies whether the listener performs a direct hand-off of the session, or redirects the session. + public SessionModeType SessionMode { get; } + /// Specifies whether the connection string is using the long (LONG), Easy Connect (EZCONNECT), or Easy Connect Plus (EZCONNECTPLUS) format. + public SyntaxFormatType SyntaxFormat { get; } + /// Specifies whether the TLS handshake is using one-way (SERVER) or mutual (MUTUAL) authentication. + public TlsAuthenticationType? TlsAuthentication { get; } + /// Connection string value. + public string Value { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ProtocolType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ProtocolType.cs new file mode 100644 index 000000000000..2b364ca99b4b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ProtocolType.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.OracleDatabase.Models +{ + /// Protocol type enum. + public readonly partial struct ProtocolType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProtocolType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TCPValue = "TCP"; + private const string TCPSValue = "TCPS"; + + /// TCP protocol. + public static ProtocolType TCP { get; } = new ProtocolType(TCPValue); + /// TCPS protocol. + public static ProtocolType TCPS { get; } = new ProtocolType(TCPSValue); + /// Determines if two values are the same. + public static bool operator ==(ProtocolType left, ProtocolType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProtocolType left, ProtocolType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProtocolType(string value) => new ProtocolType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProtocolType other && Equals(other); + /// + public bool Equals(ProtocolType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RefreshableModelType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RefreshableModelType.cs new file mode 100644 index 000000000000..a6a140842c3b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RefreshableModelType.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.OracleDatabase.Models +{ + /// Refreshable model type enum. + public readonly partial struct RefreshableModelType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RefreshableModelType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutomaticValue = "Automatic"; + private const string ManualValue = "Manual"; + + /// Automatic refreshable model type. + public static RefreshableModelType Automatic { get; } = new RefreshableModelType(AutomaticValue); + /// Manual refreshable model type. + public static RefreshableModelType Manual { get; } = new RefreshableModelType(ManualValue); + /// Determines if two values are the same. + public static bool operator ==(RefreshableModelType left, RefreshableModelType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RefreshableModelType left, RefreshableModelType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator RefreshableModelType(string value) => new RefreshableModelType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RefreshableModelType other && Equals(other); + /// + public bool Equals(RefreshableModelType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RefreshableStatusType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RefreshableStatusType.cs new file mode 100644 index 000000000000..02162cf82cc5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RefreshableStatusType.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.OracleDatabase.Models +{ + /// Refreshable status type enum. + public readonly partial struct RefreshableStatusType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RefreshableStatusType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RefreshingValue = "Refreshing"; + private const string NotRefreshingValue = "NotRefreshing"; + + /// Refreshing status. + public static RefreshableStatusType Refreshing { get; } = new RefreshableStatusType(RefreshingValue); + /// NotRefreshing status. + public static RefreshableStatusType NotRefreshing { get; } = new RefreshableStatusType(NotRefreshingValue); + /// Determines if two values are the same. + public static bool operator ==(RefreshableStatusType left, RefreshableStatusType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RefreshableStatusType left, RefreshableStatusType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator RefreshableStatusType(string value) => new RefreshableStatusType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RefreshableStatusType other && Equals(other); + /// + public bool Equals(RefreshableStatusType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.Serialization.cs new file mode 100644 index 000000000000..689e51f77708 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + public partial class RemoveVirtualMachineFromExadbVmClusterDetails : 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(RemoveVirtualMachineFromExadbVmClusterDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("dbNodes"u8); + writer.WriteStartArray(); + foreach (var item in DbNodes) + { + 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 + } + } + } + + RemoveVirtualMachineFromExadbVmClusterDetails 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(RemoveVirtualMachineFromExadbVmClusterDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRemoveVirtualMachineFromExadbVmClusterDetails(document.RootElement, options); + } + + internal static RemoveVirtualMachineFromExadbVmClusterDetails DeserializeRemoveVirtualMachineFromExadbVmClusterDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList dbNodes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dbNodes"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DbNodeDetails.DeserializeDbNodeDetails(item, options)); + } + dbNodes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RemoveVirtualMachineFromExadbVmClusterDetails(dbNodes, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RemoveVirtualMachineFromExadbVmClusterDetails)} does not support writing '{options.Format}' format."); + } + } + + RemoveVirtualMachineFromExadbVmClusterDetails 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 DeserializeRemoveVirtualMachineFromExadbVmClusterDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RemoveVirtualMachineFromExadbVmClusterDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.cs new file mode 100644 index 000000000000..166310f15da0 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RemoveVirtualMachineFromExadbVmClusterDetails.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 System.Linq; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Details of removing Virtual Machines from the Exadata VM cluster on Exascale Infrastructure. Applies to Exadata Database Service on Exascale Infrastructure only. + public partial class RemoveVirtualMachineFromExadbVmClusterDetails + { + /// + /// 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 list of ExaCS DB nodes for the Exadata VM cluster on Exascale Infrastructure to be removed. + /// is null. + public RemoveVirtualMachineFromExadbVmClusterDetails(IEnumerable dbNodes) + { + Argument.AssertNotNull(dbNodes, nameof(dbNodes)); + + DbNodes = dbNodes.ToList(); + } + + /// Initializes a new instance of . + /// The list of ExaCS DB nodes for the Exadata VM cluster on Exascale Infrastructure to be removed. + /// Keeps track of any properties unknown to the library. + internal RemoveVirtualMachineFromExadbVmClusterDetails(IList dbNodes, IDictionary serializedAdditionalRawData) + { + DbNodes = dbNodes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RemoveVirtualMachineFromExadbVmClusterDetails() + { + } + + /// The list of ExaCS DB nodes for the Exadata VM cluster on Exascale Infrastructure to be removed. + public IList DbNodes { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RepeatCadenceType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RepeatCadenceType.cs new file mode 100644 index 000000000000..f1cd9eb8c104 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RepeatCadenceType.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.OracleDatabase.Models +{ + /// Repeat cadence type enum. + public readonly partial struct RepeatCadenceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RepeatCadenceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OneTimeValue = "OneTime"; + private const string WeeklyValue = "Weekly"; + private const string MonthlyValue = "Monthly"; + private const string YearlyValue = "Yearly"; + + /// Repeat one time. + public static RepeatCadenceType OneTime { get; } = new RepeatCadenceType(OneTimeValue); + /// Repeat weekly. + public static RepeatCadenceType Weekly { get; } = new RepeatCadenceType(WeeklyValue); + /// Repeat monthly. + public static RepeatCadenceType Monthly { get; } = new RepeatCadenceType(MonthlyValue); + /// Repeat yearly. + public static RepeatCadenceType Yearly { get; } = new RepeatCadenceType(YearlyValue); + /// Determines if two values are the same. + public static bool operator ==(RepeatCadenceType left, RepeatCadenceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RepeatCadenceType left, RepeatCadenceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator RepeatCadenceType(string value) => new RepeatCadenceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RepeatCadenceType other && Equals(other); + /// + public bool Equals(RepeatCadenceType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ResourceProvisioningState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ResourceProvisioningState.cs new file mode 100644 index 000000000000..efb39ea8ad8b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ResourceProvisioningState.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.OracleDatabase.Models +{ + /// The provisioning state of a resource type. + public readonly partial struct ResourceProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResourceProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Resource has been created. + public static ResourceProvisioningState Succeeded { get; } = new ResourceProvisioningState(SucceededValue); + /// Resource creation failed. + public static ResourceProvisioningState Failed { get; } = new ResourceProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ResourceProvisioningState Canceled { get; } = new ResourceProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(ResourceProvisioningState left, ResourceProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResourceProvisioningState left, ResourceProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ResourceProvisioningState(string value) => new ResourceProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResourceProvisioningState other && Equals(other); + /// + public bool Equals(ResourceProvisioningState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RestoreAutonomousDatabaseDetails.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RestoreAutonomousDatabaseDetails.Serialization.cs new file mode 100644 index 000000000000..fb47b8679661 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RestoreAutonomousDatabaseDetails.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.OracleDatabase.Models +{ + public partial class RestoreAutonomousDatabaseDetails : 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(RestoreAutonomousDatabaseDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("timestamp"u8); + writer.WriteStringValue(Timestamp, "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 + } + } + } + + RestoreAutonomousDatabaseDetails 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(RestoreAutonomousDatabaseDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRestoreAutonomousDatabaseDetails(document.RootElement, options); + } + + internal static RestoreAutonomousDatabaseDetails DeserializeRestoreAutonomousDatabaseDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset timestamp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("timestamp"u8)) + { + timestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RestoreAutonomousDatabaseDetails(timestamp, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RestoreAutonomousDatabaseDetails)} does not support writing '{options.Format}' format."); + } + } + + RestoreAutonomousDatabaseDetails 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 DeserializeRestoreAutonomousDatabaseDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RestoreAutonomousDatabaseDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RestoreAutonomousDatabaseDetails.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RestoreAutonomousDatabaseDetails.cs new file mode 100644 index 000000000000..25ad822e6386 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RestoreAutonomousDatabaseDetails.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Details to restore an Oracle Autonomous Database. + public partial class RestoreAutonomousDatabaseDetails + { + /// + /// 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 time to restore the database to. + public RestoreAutonomousDatabaseDetails(DateTimeOffset timestamp) + { + Timestamp = timestamp; + } + + /// Initializes a new instance of . + /// The time to restore the database to. + /// Keeps track of any properties unknown to the library. + internal RestoreAutonomousDatabaseDetails(DateTimeOffset timestamp, IDictionary serializedAdditionalRawData) + { + Timestamp = timestamp; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RestoreAutonomousDatabaseDetails() + { + } + + /// The time to restore the database to. + public DateTimeOffset Timestamp { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RoleType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RoleType.cs new file mode 100644 index 000000000000..56d3d180c3de --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/RoleType.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// Role type enum. + public readonly partial struct RoleType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RoleType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PrimaryValue = "Primary"; + private const string StandbyValue = "Standby"; + private const string DisabledStandbyValue = "DisabledStandby"; + private const string BackupCopyValue = "BackupCopy"; + private const string SnapshotStandbyValue = "SnapshotStandby"; + + /// Primary role. + public static RoleType Primary { get; } = new RoleType(PrimaryValue); + /// Standby role. + public static RoleType Standby { get; } = new RoleType(StandbyValue); + /// DisabledStandby role. + public static RoleType DisabledStandby { get; } = new RoleType(DisabledStandbyValue); + /// BackupCopy role. + public static RoleType BackupCopy { get; } = new RoleType(BackupCopyValue); + /// SnapshotStandby role. + public static RoleType SnapshotStandby { get; } = new RoleType(SnapshotStandbyValue); + /// Determines if two values are the same. + public static bool operator ==(RoleType left, RoleType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RoleType left, RoleType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator RoleType(string value) => new RoleType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RoleType other && Equals(other); + /// + public bool Equals(RoleType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ScheduledOperationsType.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ScheduledOperationsType.Serialization.cs new file mode 100644 index 000000000000..db6693f1608f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ScheduledOperationsType.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.OracleDatabase.Models +{ + public partial class ScheduledOperationsType : 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(ScheduledOperationsType)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("dayOfWeek"u8); + writer.WriteObjectValue(DayOfWeek, options); + if (Optional.IsDefined(ScheduledStartTime)) + { + writer.WritePropertyName("scheduledStartTime"u8); + writer.WriteStringValue(ScheduledStartTime); + } + if (Optional.IsDefined(ScheduledStopTime)) + { + writer.WritePropertyName("scheduledStopTime"u8); + writer.WriteStringValue(ScheduledStopTime); + } + 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 + } + } + } + + ScheduledOperationsType 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(ScheduledOperationsType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeScheduledOperationsType(document.RootElement, options); + } + + internal static ScheduledOperationsType DeserializeScheduledOperationsType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DayOfWeek dayOfWeek = default; + string scheduledStartTime = default; + string scheduledStopTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dayOfWeek"u8)) + { + dayOfWeek = DayOfWeek.DeserializeDayOfWeek(property.Value, options); + continue; + } + if (property.NameEquals("scheduledStartTime"u8)) + { + scheduledStartTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("scheduledStopTime"u8)) + { + scheduledStopTime = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ScheduledOperationsType(dayOfWeek, scheduledStartTime, scheduledStopTime, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ScheduledOperationsType)} does not support writing '{options.Format}' format."); + } + } + + ScheduledOperationsType 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 DeserializeScheduledOperationsType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ScheduledOperationsType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ScheduledOperationsType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ScheduledOperationsType.cs new file mode 100644 index 000000000000..bacd0cbd7183 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ScheduledOperationsType.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.OracleDatabase.Models +{ + /// The list of scheduled operations. + public partial class ScheduledOperationsType + { + /// + /// 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 . + /// Day of week. + /// is null. + public ScheduledOperationsType(DayOfWeek dayOfWeek) + { + Argument.AssertNotNull(dayOfWeek, nameof(dayOfWeek)); + + DayOfWeek = dayOfWeek; + } + + /// Initializes a new instance of . + /// Day of week. + /// auto start time. value must be of ISO-8601 format HH:mm. + /// auto stop time. value must be of ISO-8601 format HH:mm. + /// Keeps track of any properties unknown to the library. + internal ScheduledOperationsType(DayOfWeek dayOfWeek, string scheduledStartTime, string scheduledStopTime, IDictionary serializedAdditionalRawData) + { + DayOfWeek = dayOfWeek; + ScheduledStartTime = scheduledStartTime; + ScheduledStopTime = scheduledStopTime; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ScheduledOperationsType() + { + } + + /// Day of week. + internal DayOfWeek DayOfWeek { get; set; } + /// Name of the day of the week. + public DayOfWeekName? DayOfWeekName + { + get => DayOfWeek is null ? default(DayOfWeekName?) : DayOfWeek.Name; + set + { + DayOfWeek = value.HasValue ? new DayOfWeek(value.Value) : null; + } + } + + /// auto start time. value must be of ISO-8601 format HH:mm. + public string ScheduledStartTime { get; set; } + /// auto stop time. value must be of ISO-8601 format HH:mm. + public string ScheduledStopTime { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SessionModeType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SessionModeType.cs new file mode 100644 index 000000000000..5169914fe4ac --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SessionModeType.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.OracleDatabase.Models +{ + /// Session mode type enum. + public readonly partial struct SessionModeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SessionModeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DirectValue = "Direct"; + private const string RedirectValue = "Redirect"; + + /// Direct session mode. + public static SessionModeType Direct { get; } = new SessionModeType(DirectValue); + /// Redirect session mode. + public static SessionModeType Redirect { get; } = new SessionModeType(RedirectValue); + /// Determines if two values are the same. + public static bool operator ==(SessionModeType left, SessionModeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SessionModeType left, SessionModeType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SessionModeType(string value) => new SessionModeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SessionModeType other && Equals(other); + /// + public bool Equals(SessionModeType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ShapeFamily.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ShapeFamily.cs new file mode 100644 index 000000000000..5eefe1bf5e62 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ShapeFamily.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.OracleDatabase.Models +{ + /// Allowed values for GI Minor Versions shapeFamily filter. + public readonly partial struct ShapeFamily : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ShapeFamily(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ExadataValue = "EXADATA"; + private const string ExadbXsValue = "EXADB_XS"; + + /// Family value for Exadata Shape. + public static ShapeFamily Exadata { get; } = new ShapeFamily(ExadataValue); + /// Family value for Exadb XS Shape. + public static ShapeFamily ExadbXs { get; } = new ShapeFamily(ExadbXsValue); + /// Determines if two values are the same. + public static bool operator ==(ShapeFamily left, ShapeFamily right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ShapeFamily left, ShapeFamily right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ShapeFamily(string value) => new ShapeFamily(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ShapeFamily other && Equals(other); + /// + public bool Equals(ShapeFamily 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SourceType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SourceType.cs new file mode 100644 index 000000000000..9174d6cc359a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SourceType.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.OracleDatabase.Models +{ + /// Source type enum. + public readonly partial struct SourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string DatabaseValue = "Database"; + private const string BackupFromIdValue = "BackupFromId"; + private const string BackupFromTimestampValue = "BackupFromTimestamp"; + private const string CloneToRefreshableValue = "CloneToRefreshable"; + private const string CrossRegionDataguardValue = "CrossRegionDataguard"; + private const string CrossRegionDisasterRecoveryValue = "CrossRegionDisasterRecovery"; + + /// None source. + public static SourceType None { get; } = new SourceType(NoneValue); + /// Database source. + public static SourceType Database { get; } = new SourceType(DatabaseValue); + /// Backup from ID source. + public static SourceType BackupFromId { get; } = new SourceType(BackupFromIdValue); + /// Backup from timestamp source. + public static SourceType BackupFromTimestamp { get; } = new SourceType(BackupFromTimestampValue); + /// Clone to refreshable source. + public static SourceType CloneToRefreshable { get; } = new SourceType(CloneToRefreshableValue); + /// Cross region dataguard source. + public static SourceType CrossRegionDataguard { get; } = new SourceType(CrossRegionDataguardValue); + /// cross region disaster recovery source. + public static SourceType CrossRegionDisasterRecovery { get; } = new SourceType(CrossRegionDisasterRecoveryValue); + /// Determines if two values are the same. + public static bool operator ==(SourceType left, SourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SourceType left, SourceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SourceType(string value) => new SourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SourceType other && Equals(other); + /// + public bool Equals(SourceType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SyntaxFormatType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SyntaxFormatType.cs new file mode 100644 index 000000000000..69b89b441143 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SyntaxFormatType.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.OracleDatabase.Models +{ + /// Syntax format type enum. + public readonly partial struct SyntaxFormatType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SyntaxFormatType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LongValue = "Long"; + private const string EzconnectValue = "Ezconnect"; + private const string EzconnectplusValue = "Ezconnectplus"; + + /// Long format. + public static SyntaxFormatType Long { get; } = new SyntaxFormatType(LongValue); + /// Ezconnect format. + public static SyntaxFormatType Ezconnect { get; } = new SyntaxFormatType(EzconnectValue); + /// Ezconnectplus format. + public static SyntaxFormatType Ezconnectplus { get; } = new SyntaxFormatType(EzconnectplusValue); + /// Determines if two values are the same. + public static bool operator ==(SyntaxFormatType left, SyntaxFormatType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SyntaxFormatType left, SyntaxFormatType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SyntaxFormatType(string value) => new SyntaxFormatType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SyntaxFormatType other && Equals(other); + /// + public bool Equals(SyntaxFormatType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemShape.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemShape.cs new file mode 100644 index 000000000000..583b0dc82075 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemShape.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.OracleDatabase.Models +{ + /// Allowed values for System Shapes. + public readonly partial struct SystemShape : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SystemShape(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ExadataX9MValue = "Exadata.X9M"; + private const string ExadataX11MValue = "Exadata.X11M"; + private const string ExaDbXsValue = "ExaDbXS"; + + /// Exadata X9M shape. + public static SystemShape ExadataX9M { get; } = new SystemShape(ExadataX9MValue); + /// Exadata X11M shape. + public static SystemShape ExadataX11M { get; } = new SystemShape(ExadataX11MValue); + /// Exadata DB on Exascale Infrastructure shape. + public static SystemShape ExaDbXs { get; } = new SystemShape(ExaDbXsValue); + /// Determines if two values are the same. + public static bool operator ==(SystemShape left, SystemShape right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SystemShape left, SystemShape right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SystemShape(string value) => new SystemShape(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SystemShape other && Equals(other); + /// + public bool Equals(SystemShape 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionListResult.Serialization.cs new file mode 100644 index 000000000000..18f8328497f1 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionListResult.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.OracleDatabase.Models +{ + internal partial class SystemVersionListResult : 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(SystemVersionListResult)} 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 + } + } + } + + SystemVersionListResult 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(SystemVersionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSystemVersionListResult(document.RootElement, options); + } + + internal static SystemVersionListResult DeserializeSystemVersionListResult(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(SystemVersionData.DeserializeSystemVersionData(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 SystemVersionListResult(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); + default: + throw new FormatException($"The model {nameof(SystemVersionListResult)} does not support writing '{options.Format}' format."); + } + } + + SystemVersionListResult 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 DeserializeSystemVersionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SystemVersionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionListResult.cs new file mode 100644 index 000000000000..c063ee4a9b9a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionListResult.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.OracleDatabase.Models +{ + /// The response of a SystemVersion list operation. + internal partial class SystemVersionListResult + { + /// + /// 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 SystemVersion items on this page. + /// is null. + internal SystemVersionListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SystemVersion items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SystemVersionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SystemVersionListResult() + { + } + + /// The SystemVersion items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionProperties.Serialization.cs new file mode 100644 index 000000000000..7dd18241abef --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionProperties.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.OracleDatabase.Models +{ + internal partial class SystemVersionProperties : 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(SystemVersionProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("systemVersion"u8); + writer.WriteStringValue(SystemVersion); + 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 + } + } + } + + SystemVersionProperties 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(SystemVersionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSystemVersionProperties(document.RootElement, options); + } + + internal static SystemVersionProperties DeserializeSystemVersionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string systemVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("systemVersion"u8)) + { + systemVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SystemVersionProperties(systemVersion, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SystemVersionProperties)} does not support writing '{options.Format}' format."); + } + } + + SystemVersionProperties 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 DeserializeSystemVersionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SystemVersionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionProperties.cs new file mode 100644 index 000000000000..0fac8f4e622c --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/SystemVersionProperties.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.OracleDatabase.Models +{ + /// System Version Resource model. + internal partial class SystemVersionProperties + { + /// + /// 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 . + /// A valid Oracle System Version. + /// is null. + internal SystemVersionProperties(string systemVersion) + { + Argument.AssertNotNull(systemVersion, nameof(systemVersion)); + + SystemVersion = systemVersion; + } + + /// Initializes a new instance of . + /// A valid Oracle System Version. + /// Keeps track of any properties unknown to the library. + internal SystemVersionProperties(string systemVersion, IDictionary serializedAdditionalRawData) + { + SystemVersion = systemVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SystemVersionProperties() + { + } + + /// A valid Oracle System Version. + public string SystemVersion { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/TlsAuthenticationType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/TlsAuthenticationType.cs new file mode 100644 index 000000000000..8821a8ec81b3 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/TlsAuthenticationType.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.OracleDatabase.Models +{ + /// TLS authentication type enum. + public readonly partial struct TlsAuthenticationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TlsAuthenticationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ServerValue = "Server"; + private const string MutualValue = "Mutual"; + + /// Server authentication. + public static TlsAuthenticationType Server { get; } = new TlsAuthenticationType(ServerValue); + /// Mutual TLS. + public static TlsAuthenticationType Mutual { get; } = new TlsAuthenticationType(MutualValue); + /// Determines if two values are the same. + public static bool operator ==(TlsAuthenticationType left, TlsAuthenticationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TlsAuthenticationType left, TlsAuthenticationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TlsAuthenticationType(string value) => new TlsAuthenticationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TlsAuthenticationType other && Equals(other); + /// + public bool Equals(TlsAuthenticationType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.Serialization.cs new file mode 100644 index 000000000000..447a993a3758 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.Serialization.cs @@ -0,0 +1,890 @@ +// 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.OracleDatabase.Models +{ + internal partial class UnknownAutonomousDatabaseBaseProperties : 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(AutonomousDatabaseBaseProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + AutonomousDatabaseBaseProperties 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(AutonomousDatabaseBaseProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseBaseProperties(document.RootElement, options); + } + + internal static UnknownAutonomousDatabaseBaseProperties DeserializeUnknownAutonomousDatabaseBaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string adminPassword = default; + DataBaseType dataBaseType = "Unknown"; + AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType = default; + string characterSet = default; + float? computeCount = default; + ComputeModel? computeModel = default; + int? cpuCoreCount = default; + IList customerContacts = default; + int? dataStorageSizeInTbs = default; + int? dataStorageSizeInGbs = default; + string dbVersion = default; + WorkloadType? dbWorkload = default; + string displayName = default; + bool? isAutoScalingEnabled = default; + bool? isAutoScalingForStorageEnabled = default; + IReadOnlyList peerDbIds = default; + string peerDbId = default; + bool? isLocalDataGuardEnabled = default; + bool? isRemoteDataGuardEnabled = default; + DisasterRecoveryType? localDisasterRecoveryType = default; + DateTimeOffset? timeDisasterRecoveryRoleChanged = default; + DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration = default; + AutonomousDatabaseStandbySummary localStandbyDb = default; + int? failedDataRecoveryInSeconds = default; + bool? isMtlsConnectionRequired = default; + bool? isPreviewVersionWithServiceTermsAccepted = default; + LicenseModel? licenseModel = default; + string ncharacterSet = default; + string lifecycleDetails = default; + AzureResourceProvisioningState? provisioningState = default; + AutonomousDatabaseLifecycleState? lifecycleState = default; + ScheduledOperationsType scheduledOperations = default; + string privateEndpointIP = default; + string privateEndpointLabel = default; + string ociUrl = default; + ResourceIdentifier subnetId = default; + ResourceIdentifier vnetId = default; + DateTimeOffset? timeCreated = default; + DateTimeOffset? timeMaintenanceBegin = default; + DateTimeOffset? timeMaintenanceEnd = default; + double? actualUsedDataStorageSizeInTbs = default; + double? allocatedStorageSizeInTbs = default; + ApexDetailsType apexDetails = default; + IReadOnlyList availableUpgradeVersions = default; + ConnectionStringType connectionStrings = default; + ConnectionUrlType connectionUrls = default; + DataSafeStatusType? dataSafeStatus = default; + DatabaseEditionType? databaseEdition = default; + ResourceIdentifier autonomousDatabaseId = default; + int? inMemoryAreaInGbs = default; + DateTimeOffset? nextLongTermBackupTimeStamp = default; + LongTermBackUpScheduleDetails longTermBackupSchedule = default; + bool? isPreview = default; + int? localAdgAutoFailoverMaxDataLossLimit = default; + int? memoryPerOracleComputeUnitInGbs = default; + OpenModeType? openMode = default; + OperationsInsightsStatusType? operationsInsightsStatus = default; + PermissionLevelType? permissionLevel = default; + string privateEndpoint = default; + IReadOnlyList provisionableCpus = default; + RoleType? role = default; + string serviceConsoleUrl = default; + string sqlWebDeveloperUrl = default; + IReadOnlyList supportedRegionsToCloneTo = default; + string timeDataGuardRoleChanged = default; + string timeDeletionOfFreeAutonomousDatabase = default; + string timeLocalDataGuardEnabled = default; + string timeOfLastFailover = default; + string timeOfLastRefresh = default; + string timeOfLastRefreshPoint = default; + string timeOfLastSwitchover = default; + string timeReclamationOfFreeAutonomousDatabase = default; + int? usedDataStorageSizeInGbs = default; + int? usedDataStorageSizeInTbs = default; + string ocid = default; + int? backupRetentionPeriodInDays = default; + IList whitelistedIPs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("adminPassword"u8)) + { + adminPassword = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataBaseType"u8)) + { + dataBaseType = new DataBaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autonomousMaintenanceScheduleType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousMaintenanceScheduleType = new AutonomousMaintenanceScheduleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("characterSet"u8)) + { + characterSet = property.Value.GetString(); + continue; + } + if (property.NameEquals("computeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeCount = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("computeModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + computeModel = new ComputeModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("cpuCoreCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCoreCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("customerContacts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CustomerContact.DeserializeCustomerContact(item, options)); + } + customerContacts = array; + continue; + } + if (property.NameEquals("dataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dbVersion"u8)) + { + dbVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("dbWorkload"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbWorkload = new WorkloadType(property.Value.GetString()); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isAutoScalingEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isAutoScalingForStorageEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAutoScalingForStorageEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("peerDbIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + peerDbIds = array; + continue; + } + if (property.NameEquals("peerDbId"u8)) + { + peerDbId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isLocalDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isLocalDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isRemoteDataGuardEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isRemoteDataGuardEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("localDisasterRecoveryType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localDisasterRecoveryType = new DisasterRecoveryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeDisasterRecoveryRoleChanged"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeDisasterRecoveryRoleChanged = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("remoteDisasterRecoveryConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remoteDisasterRecoveryConfiguration = DisasterRecoveryConfigurationDetails.DeserializeDisasterRecoveryConfigurationDetails(property.Value, options); + continue; + } + if (property.NameEquals("localStandbyDb"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localStandbyDb = AutonomousDatabaseStandbySummary.DeserializeAutonomousDatabaseStandbySummary(property.Value, options); + continue; + } + if (property.NameEquals("failedDataRecoveryInSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failedDataRecoveryInSeconds = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isMtlsConnectionRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMtlsConnectionRequired = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isPreviewVersionWithServiceTermsAccepted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPreviewVersionWithServiceTermsAccepted = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("licenseModel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + licenseModel = new LicenseModel(property.Value.GetString()); + continue; + } + if (property.NameEquals("ncharacterSet"u8)) + { + ncharacterSet = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new AutonomousDatabaseLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("scheduledOperations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledOperations = ScheduledOperationsType.DeserializeScheduledOperationsType(property.Value, options); + continue; + } + if (property.NameEquals("privateEndpointIp"u8)) + { + privateEndpointIP = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateEndpointLabel"u8)) + { + privateEndpointLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("ociUrl"u8)) + { + ociUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceBegin"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceBegin = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("timeMaintenanceEnd"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeMaintenanceEnd = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("actualUsedDataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + actualUsedDataStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("allocatedStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocatedStorageSizeInTbs = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("apexDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + apexDetails = ApexDetailsType.DeserializeApexDetailsType(property.Value, options); + continue; + } + if (property.NameEquals("availableUpgradeVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableUpgradeVersions = array; + continue; + } + if (property.NameEquals("connectionStrings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionStrings = ConnectionStringType.DeserializeConnectionStringType(property.Value, options); + continue; + } + if (property.NameEquals("connectionUrls"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionUrls = ConnectionUrlType.DeserializeConnectionUrlType(property.Value, options); + continue; + } + if (property.NameEquals("dataSafeStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataSafeStatus = new DataSafeStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseEdition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseEdition = new DatabaseEditionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("autonomousDatabaseId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autonomousDatabaseId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("inMemoryAreaInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inMemoryAreaInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nextLongTermBackupTimeStamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLongTermBackupTimeStamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("longTermBackupSchedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + longTermBackupSchedule = LongTermBackUpScheduleDetails.DeserializeLongTermBackUpScheduleDetails(property.Value, options); + continue; + } + if (property.NameEquals("isPreview"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPreview = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("localAdgAutoFailoverMaxDataLossLimit"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localAdgAutoFailoverMaxDataLossLimit = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("memoryPerOracleComputeUnitInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memoryPerOracleComputeUnitInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("openMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + openMode = new OpenModeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("operationsInsightsStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operationsInsightsStatus = new OperationsInsightsStatusType(property.Value.GetString()); + continue; + } + if (property.NameEquals("permissionLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + permissionLevel = new PermissionLevelType(property.Value.GetString()); + continue; + } + if (property.NameEquals("privateEndpoint"u8)) + { + privateEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisionableCpus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + provisionableCpus = array; + continue; + } + if (property.NameEquals("role"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + role = new RoleType(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceConsoleUrl"u8)) + { + serviceConsoleUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("sqlWebDeveloperUrl"u8)) + { + sqlWebDeveloperUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("supportedRegionsToCloneTo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + supportedRegionsToCloneTo = array; + continue; + } + if (property.NameEquals("timeDataGuardRoleChanged"u8)) + { + timeDataGuardRoleChanged = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeDeletionOfFreeAutonomousDatabase"u8)) + { + timeDeletionOfFreeAutonomousDatabase = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeLocalDataGuardEnabled"u8)) + { + timeLocalDataGuardEnabled = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastFailover"u8)) + { + timeOfLastFailover = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastRefresh"u8)) + { + timeOfLastRefresh = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastRefreshPoint"u8)) + { + timeOfLastRefreshPoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfLastSwitchover"u8)) + { + timeOfLastSwitchover = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeReclamationOfFreeAutonomousDatabase"u8)) + { + timeReclamationOfFreeAutonomousDatabase = property.Value.GetString(); + continue; + } + if (property.NameEquals("usedDataStorageSizeInGbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedDataStorageSizeInGbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("usedDataStorageSizeInTbs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usedDataStorageSizeInTbs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("backupRetentionPeriodInDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backupRetentionPeriodInDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("whitelistedIps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + whitelistedIPs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownAutonomousDatabaseBaseProperties( + adminPassword, + dataBaseType, + autonomousMaintenanceScheduleType, + characterSet, + computeCount, + computeModel, + cpuCoreCount, + customerContacts ?? new ChangeTrackingList(), + dataStorageSizeInTbs, + dataStorageSizeInGbs, + dbVersion, + dbWorkload, + displayName, + isAutoScalingEnabled, + isAutoScalingForStorageEnabled, + peerDbIds ?? new ChangeTrackingList(), + peerDbId, + isLocalDataGuardEnabled, + isRemoteDataGuardEnabled, + localDisasterRecoveryType, + timeDisasterRecoveryRoleChanged, + remoteDisasterRecoveryConfiguration, + localStandbyDb, + failedDataRecoveryInSeconds, + isMtlsConnectionRequired, + isPreviewVersionWithServiceTermsAccepted, + licenseModel, + ncharacterSet, + lifecycleDetails, + provisioningState, + lifecycleState, + scheduledOperations, + privateEndpointIP, + privateEndpointLabel, + ociUrl, + subnetId, + vnetId, + timeCreated, + timeMaintenanceBegin, + timeMaintenanceEnd, + actualUsedDataStorageSizeInTbs, + allocatedStorageSizeInTbs, + apexDetails, + availableUpgradeVersions ?? new ChangeTrackingList(), + connectionStrings, + connectionUrls, + dataSafeStatus, + databaseEdition, + autonomousDatabaseId, + inMemoryAreaInGbs, + nextLongTermBackupTimeStamp, + longTermBackupSchedule, + isPreview, + localAdgAutoFailoverMaxDataLossLimit, + memoryPerOracleComputeUnitInGbs, + openMode, + operationsInsightsStatus, + permissionLevel, + privateEndpoint, + provisionableCpus ?? new ChangeTrackingList(), + role, + serviceConsoleUrl, + sqlWebDeveloperUrl, + supportedRegionsToCloneTo ?? new ChangeTrackingList(), + timeDataGuardRoleChanged, + timeDeletionOfFreeAutonomousDatabase, + timeLocalDataGuardEnabled, + timeOfLastFailover, + timeOfLastRefresh, + timeOfLastRefreshPoint, + timeOfLastSwitchover, + timeReclamationOfFreeAutonomousDatabase, + usedDataStorageSizeInGbs, + usedDataStorageSizeInTbs, + ocid, + backupRetentionPeriodInDays, + whitelistedIPs ?? 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); + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseBaseProperties)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseBaseProperties 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 DeserializeAutonomousDatabaseBaseProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseBaseProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.cs new file mode 100644 index 000000000000..0f83cf6074a9 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/UnknownAutonomousDatabaseBaseProperties.cs @@ -0,0 +1,106 @@ +// 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.OracleDatabase.Models +{ + /// Unknown version of AutonomousDatabaseBaseProperties. + internal partial class UnknownAutonomousDatabaseBaseProperties : AutonomousDatabaseBaseProperties + { + /// Initializes a new instance of . + /// Admin password. + /// Database type to be created. + /// The maintenance schedule type of the Autonomous Database Serverless. + /// The character set for the autonomous database. + /// The compute amount (CPUs) available to the database. + /// The compute model of the Autonomous Database. + /// The number of CPU cores to be made available to the database. + /// Customer Contacts. + /// The quantity of data in the database, in terabytes. + /// The size, in gigabytes, of the data volume that will be created and attached to the database. + /// A valid Oracle Database version for Autonomous Database. + /// The Autonomous Database workload type. + /// The user-friendly name for the Autonomous Database. + /// Indicates if auto scaling is enabled for the Autonomous Database CPU core count. + /// Indicates if auto scaling is enabled for the Autonomous Database storage. + /// The list of Azure resource IDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have Azure IDs. + /// The Azure resource ID of the Disaster Recovery peer database, which is located in a different region from the current peer database. + /// Indicates whether the Autonomous Database has local or called in-region Data Guard enabled. + /// Indicates whether the Autonomous Database has Cross Region Data Guard enabled. + /// Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance.Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover.Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + /// The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + /// Indicates remote disaster recovery configuration. + /// Local Autonomous Disaster Recovery standby database details. + /// Indicates the number of seconds of data loss for a Data Guard failover. + /// Specifies if the Autonomous Database requires mTLS connections. + /// Specifies if the Autonomous Database preview version is being provisioned. + /// The Oracle license model that applies to the Oracle Autonomous Database. The default is LICENSE_INCLUDED. + /// The character set for the Autonomous Database. + /// Additional information about the current lifecycle state. + /// Azure resource provisioning state. + /// Views lifecycleState. + /// The list of scheduled operations. + /// The private endpoint Ip address for the resource. + /// The resource's private endpoint label. + /// HTTPS link to OCI resources exposed to Azure Customer via Azure Interface. + /// Client subnet. + /// VNET for network connectivity. + /// The date and time that the database was created. + /// The date and time when maintenance will begin. + /// The date and time when maintenance will end. + /// The current amount of storage in use for user and system data, in terabytes (TB). + /// The amount of storage currently allocated for the database tables and billed for, rounded up. + /// Information about Oracle APEX Application Development. + /// List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. + /// The connection string used to connect to the Autonomous Database. + /// The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. + /// Status of the Data Safe registration for this Autonomous Database. + /// The Oracle Database Edition that applies to the Autonomous databases. + /// Autonomous Database ID. + /// The area assigned to In-Memory tables in Autonomous Database. + /// The date and time when the next long-term backup would be created. + /// Details for the long-term backup schedule. + /// Indicates if the Autonomous Database version is a preview version. + /// Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard. + /// The amount of memory (in GBs) enabled per ECPU or OCPU. + /// Indicates the Autonomous Database mode. + /// Status of Operations Insights for this Autonomous Database. + /// The Autonomous Database permission level. + /// The private endpoint for the resource. + /// An array of CPU values that an Autonomous Database can be scaled to. + /// The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. + /// The URL of the Service Console for the Autonomous Database. + /// The SQL Web Developer URL for the Oracle Autonomous Database. + /// The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. + /// The date and time the Autonomous Data Guard role was switched for the Autonomous Database. + /// The date and time the Always Free database will be automatically deleted because of inactivity. + /// The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. + /// The timestamp of the last failover operation. + /// The date and time when last refresh happened. + /// The refresh point timestamp (UTC). + /// The timestamp of the last switchover operation for the Autonomous Database. + /// The date and time the Always Free database will be stopped because of inactivity. + /// The storage space consumed by Autonomous Database in GBs. + /// The amount of storage that has been used, in terabytes. + /// Database ocid. + /// Retention period, in days, for long-term backups. + /// The client IP access control list (ACL). This is an array of CIDR notations and/or IP addresses. Values should be separate strings, separated by commas. Example: ['1.1.1.1','1.1.1.0/24','1.1.2.25']. + /// Keeps track of any properties unknown to the library. + internal UnknownAutonomousDatabaseBaseProperties(string adminPassword, DataBaseType dataBaseType, AutonomousMaintenanceScheduleType? autonomousMaintenanceScheduleType, string characterSet, float? computeCount, ComputeModel? computeModel, int? cpuCoreCount, IList customerContacts, int? dataStorageSizeInTbs, int? dataStorageSizeInGbs, string dbVersion, WorkloadType? dbWorkload, string displayName, bool? isAutoScalingEnabled, bool? isAutoScalingForStorageEnabled, IReadOnlyList peerDbIds, string peerDbId, bool? isLocalDataGuardEnabled, bool? isRemoteDataGuardEnabled, DisasterRecoveryType? localDisasterRecoveryType, DateTimeOffset? timeDisasterRecoveryRoleChanged, DisasterRecoveryConfigurationDetails remoteDisasterRecoveryConfiguration, AutonomousDatabaseStandbySummary localStandbyDb, int? failedDataRecoveryInSeconds, bool? isMtlsConnectionRequired, bool? isPreviewVersionWithServiceTermsAccepted, LicenseModel? licenseModel, string ncharacterSet, string lifecycleDetails, AzureResourceProvisioningState? provisioningState, AutonomousDatabaseLifecycleState? lifecycleState, ScheduledOperationsType scheduledOperations, string privateEndpointIP, string privateEndpointLabel, string ociUri, ResourceIdentifier subnetId, ResourceIdentifier vnetId, DateTimeOffset? timeCreated, DateTimeOffset? timeMaintenanceBegin, DateTimeOffset? timeMaintenanceEnd, double? actualUsedDataStorageSizeInTbs, double? allocatedStorageSizeInTbs, ApexDetailsType apexDetails, IReadOnlyList availableUpgradeVersions, ConnectionStringType connectionStrings, ConnectionUrlType connectionUrls, DataSafeStatusType? dataSafeStatus, DatabaseEditionType? databaseEdition, ResourceIdentifier autonomousDatabaseId, int? inMemoryAreaInGbs, DateTimeOffset? nextLongTermBackupTimeStamp, LongTermBackUpScheduleDetails longTermBackupSchedule, bool? isPreview, int? localAdgAutoFailoverMaxDataLossLimit, int? memoryPerOracleComputeUnitInGbs, OpenModeType? openMode, OperationsInsightsStatusType? operationsInsightsStatus, PermissionLevelType? permissionLevel, string privateEndpoint, IReadOnlyList provisionableCpus, RoleType? role, string serviceConsoleUri, string sqlWebDeveloperUri, IReadOnlyList supportedRegionsToCloneTo, string timeDataGuardRoleChanged, string timeDeletionOfFreeAutonomousDatabase, string timeLocalDataGuardEnabled, string timeOfLastFailover, string timeOfLastRefresh, string timeOfLastRefreshPoint, string timeOfLastSwitchover, string timeReclamationOfFreeAutonomousDatabase, int? usedDataStorageSizeInGbs, int? usedDataStorageSizeInTbs, string ocid, int? backupRetentionPeriodInDays, IList whitelistedIPs, IDictionary serializedAdditionalRawData) : base(adminPassword, dataBaseType, autonomousMaintenanceScheduleType, characterSet, computeCount, computeModel, cpuCoreCount, customerContacts, dataStorageSizeInTbs, dataStorageSizeInGbs, dbVersion, dbWorkload, displayName, isAutoScalingEnabled, isAutoScalingForStorageEnabled, peerDbIds, peerDbId, isLocalDataGuardEnabled, isRemoteDataGuardEnabled, localDisasterRecoveryType, timeDisasterRecoveryRoleChanged, remoteDisasterRecoveryConfiguration, localStandbyDb, failedDataRecoveryInSeconds, isMtlsConnectionRequired, isPreviewVersionWithServiceTermsAccepted, licenseModel, ncharacterSet, lifecycleDetails, provisioningState, lifecycleState, scheduledOperations, privateEndpointIP, privateEndpointLabel, ociUri, subnetId, vnetId, timeCreated, timeMaintenanceBegin, timeMaintenanceEnd, actualUsedDataStorageSizeInTbs, allocatedStorageSizeInTbs, apexDetails, availableUpgradeVersions, connectionStrings, connectionUrls, dataSafeStatus, databaseEdition, autonomousDatabaseId, inMemoryAreaInGbs, nextLongTermBackupTimeStamp, longTermBackupSchedule, isPreview, localAdgAutoFailoverMaxDataLossLimit, memoryPerOracleComputeUnitInGbs, openMode, operationsInsightsStatus, permissionLevel, privateEndpoint, provisionableCpus, role, serviceConsoleUri, sqlWebDeveloperUri, supportedRegionsToCloneTo, timeDataGuardRoleChanged, timeDeletionOfFreeAutonomousDatabase, timeLocalDataGuardEnabled, timeOfLastFailover, timeOfLastRefresh, timeOfLastRefreshPoint, timeOfLastSwitchover, timeReclamationOfFreeAutonomousDatabase, usedDataStorageSizeInGbs, usedDataStorageSizeInTbs, ocid, backupRetentionPeriodInDays, whitelistedIPs, serializedAdditionalRawData) + { + DataBaseType = dataBaseType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownAutonomousDatabaseBaseProperties() + { + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressLifecycleState.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressLifecycleState.cs new file mode 100644 index 000000000000..2fc4c539b55f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressLifecycleState.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.OracleDatabase.Models +{ + /// VirtualNetworkAddressLifecycleState enum. + public readonly partial struct VirtualNetworkAddressLifecycleState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VirtualNetworkAddressLifecycleState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ProvisioningValue = "Provisioning"; + private const string AvailableValue = "Available"; + private const string TerminatingValue = "Terminating"; + private const string TerminatedValue = "Terminated"; + private const string FailedValue = "Failed"; + + /// Indicates that resource in Provisioning state. + public static VirtualNetworkAddressLifecycleState Provisioning { get; } = new VirtualNetworkAddressLifecycleState(ProvisioningValue); + /// Indicates that resource in Available state. + public static VirtualNetworkAddressLifecycleState Available { get; } = new VirtualNetworkAddressLifecycleState(AvailableValue); + /// Indicates that resource in Terminating state. + public static VirtualNetworkAddressLifecycleState Terminating { get; } = new VirtualNetworkAddressLifecycleState(TerminatingValue); + /// Indicates that resource in Terminated state. + public static VirtualNetworkAddressLifecycleState Terminated { get; } = new VirtualNetworkAddressLifecycleState(TerminatedValue); + /// Indicates that resource in Failed state. + public static VirtualNetworkAddressLifecycleState Failed { get; } = new VirtualNetworkAddressLifecycleState(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(VirtualNetworkAddressLifecycleState left, VirtualNetworkAddressLifecycleState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VirtualNetworkAddressLifecycleState left, VirtualNetworkAddressLifecycleState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VirtualNetworkAddressLifecycleState(string value) => new VirtualNetworkAddressLifecycleState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VirtualNetworkAddressLifecycleState other && Equals(other); + /// + public bool Equals(VirtualNetworkAddressLifecycleState 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressListResult.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressListResult.Serialization.cs new file mode 100644 index 000000000000..b9d81a4a5892 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressListResult.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.OracleDatabase.Models +{ + internal partial class VirtualNetworkAddressListResult : 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(VirtualNetworkAddressListResult)} 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 + } + } + } + + VirtualNetworkAddressListResult 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(VirtualNetworkAddressListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVirtualNetworkAddressListResult(document.RootElement, options); + } + + internal static VirtualNetworkAddressListResult DeserializeVirtualNetworkAddressListResult(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(VirtualNetworkAddressData.DeserializeVirtualNetworkAddressData(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 VirtualNetworkAddressListResult(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); + default: + throw new FormatException($"The model {nameof(VirtualNetworkAddressListResult)} does not support writing '{options.Format}' format."); + } + } + + VirtualNetworkAddressListResult 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 DeserializeVirtualNetworkAddressListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VirtualNetworkAddressListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressListResult.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressListResult.cs new file mode 100644 index 000000000000..219beb2ad7bb --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressListResult.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.OracleDatabase.Models +{ + /// The response of a VirtualNetworkAddress list operation. + internal partial class VirtualNetworkAddressListResult + { + /// + /// 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 VirtualNetworkAddress items on this page. + /// is null. + internal VirtualNetworkAddressListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The VirtualNetworkAddress items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal VirtualNetworkAddressListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VirtualNetworkAddressListResult() + { + } + + /// The VirtualNetworkAddress items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressProperties.Serialization.cs new file mode 100644 index 000000000000..0ecaf87f7ecd --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressProperties.Serialization.cs @@ -0,0 +1,227 @@ +// 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.OracleDatabase.Models +{ + public partial class VirtualNetworkAddressProperties : 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(VirtualNetworkAddressProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IPAddress)) + { + writer.WritePropertyName("ipAddress"u8); + writer.WriteStringValue(IPAddress); + } + if (Optional.IsDefined(VmOcid)) + { + writer.WritePropertyName("vmOcid"u8); + writer.WriteStringValue(VmOcid); + } + if (options.Format != "W" && Optional.IsDefined(Ocid)) + { + writer.WritePropertyName("ocid"u8); + writer.WriteStringValue(Ocid); + } + if (options.Format != "W" && Optional.IsDefined(Domain)) + { + writer.WritePropertyName("domain"u8); + writer.WriteStringValue(Domain); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleDetails)) + { + writer.WritePropertyName("lifecycleDetails"u8); + writer.WriteStringValue(LifecycleDetails); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(LifecycleState)) + { + writer.WritePropertyName("lifecycleState"u8); + writer.WriteStringValue(LifecycleState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TimeAssigned)) + { + writer.WritePropertyName("timeAssigned"u8); + writer.WriteStringValue(TimeAssigned.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 + } + } + } + + VirtualNetworkAddressProperties 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(VirtualNetworkAddressProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVirtualNetworkAddressProperties(document.RootElement, options); + } + + internal static VirtualNetworkAddressProperties DeserializeVirtualNetworkAddressProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string ipAddress = default; + string vmOcid = default; + string ocid = default; + string domain = default; + string lifecycleDetails = default; + AzureResourceProvisioningState? provisioningState = default; + VirtualNetworkAddressLifecycleState? lifecycleState = default; + DateTimeOffset? timeAssigned = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("vmOcid"u8)) + { + vmOcid = property.Value.GetString(); + continue; + } + if (property.NameEquals("ocid"u8)) + { + ocid = property.Value.GetString(); + continue; + } + if (property.NameEquals("domain"u8)) + { + domain = property.Value.GetString(); + continue; + } + if (property.NameEquals("lifecycleDetails"u8)) + { + lifecycleDetails = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("lifecycleState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleState = new VirtualNetworkAddressLifecycleState(property.Value.GetString()); + continue; + } + if (property.NameEquals("timeAssigned"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeAssigned = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VirtualNetworkAddressProperties( + ipAddress, + vmOcid, + ocid, + domain, + lifecycleDetails, + provisioningState, + lifecycleState, + timeAssigned, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VirtualNetworkAddressProperties)} does not support writing '{options.Format}' format."); + } + } + + VirtualNetworkAddressProperties 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 DeserializeVirtualNetworkAddressProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VirtualNetworkAddressProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressProperties.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressProperties.cs new file mode 100644 index 000000000000..f424a6b592ef --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/VirtualNetworkAddressProperties.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.OracleDatabase.Models +{ + /// virtualNetworkAddress resource properties. + public partial class VirtualNetworkAddressProperties + { + /// + /// 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 VirtualNetworkAddressProperties() + { + } + + /// Initializes a new instance of . + /// Virtual network Address address. + /// Virtual Machine OCID. + /// Application VIP OCID. + /// Virtual network address fully qualified domain name. + /// Additional information about the current lifecycle state of the application virtual IP (VIP) address. + /// Azure resource provisioning state. + /// virtual network address lifecycle state. + /// The date and time when the create operation for the application virtual IP (VIP) address completed. + /// Keeps track of any properties unknown to the library. + internal VirtualNetworkAddressProperties(string ipAddress, string vmOcid, string ocid, string domain, string lifecycleDetails, AzureResourceProvisioningState? provisioningState, VirtualNetworkAddressLifecycleState? lifecycleState, DateTimeOffset? timeAssigned, IDictionary serializedAdditionalRawData) + { + IPAddress = ipAddress; + VmOcid = vmOcid; + Ocid = ocid; + Domain = domain; + LifecycleDetails = lifecycleDetails; + ProvisioningState = provisioningState; + LifecycleState = lifecycleState; + TimeAssigned = timeAssigned; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Virtual network Address address. + public string IPAddress { get; set; } + /// Virtual Machine OCID. + public string VmOcid { get; set; } + /// Application VIP OCID. + public string Ocid { get; } + /// Virtual network address fully qualified domain name. + public string Domain { get; } + /// Additional information about the current lifecycle state of the application virtual IP (VIP) address. + public string LifecycleDetails { get; } + /// Azure resource provisioning state. + public AzureResourceProvisioningState? ProvisioningState { get; } + /// virtual network address lifecycle state. + public VirtualNetworkAddressLifecycleState? LifecycleState { get; } + /// The date and time when the create operation for the application virtual IP (VIP) address completed. + public DateTimeOffset? TimeAssigned { get; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/WorkloadType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/WorkloadType.cs new file mode 100644 index 000000000000..f9aa03dc16a3 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/WorkloadType.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.OracleDatabase.Models +{ + /// WorkloadType enum. + public readonly partial struct WorkloadType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public WorkloadType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OLTPValue = "OLTP"; + private const string DWValue = "DW"; + private const string AJDValue = "AJD"; + private const string APEXValue = "APEX"; + + /// OLTP - indicates an Autonomous Transaction Processing database. + public static WorkloadType OLTP { get; } = new WorkloadType(OLTPValue); + /// DW - indicates an Autonomous Data Warehouse database. + public static WorkloadType DW { get; } = new WorkloadType(DWValue); + /// AJD - indicates an Autonomous JSON Database. + public static WorkloadType AJD { get; } = new WorkloadType(AJDValue); + /// APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + public static WorkloadType APEX { get; } = new WorkloadType(APEXValue); + /// Determines if two values are the same. + public static bool operator ==(WorkloadType left, WorkloadType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(WorkloadType left, WorkloadType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator WorkloadType(string value) => new WorkloadType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WorkloadType other && Equals(other); + /// + public bool Equals(WorkloadType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ZoneType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ZoneType.cs new file mode 100644 index 000000000000..8a302a4cd1b6 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ZoneType.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.OracleDatabase.Models +{ + /// Zone type enum. + public readonly partial struct ZoneType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ZoneType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PrimaryValue = "Primary"; + private const string SecondaryValue = "Secondary"; + + /// Primary zone. + public static ZoneType Primary { get; } = new ZoneType(PrimaryValue); + /// Secondary zone. + public static ZoneType Secondary { get; } = new ZoneType(SecondaryValue); + /// Determines if two values are the same. + public static bool operator ==(ZoneType left, ZoneType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ZoneType left, ZoneType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ZoneType(string value) => new ZoneType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ZoneType other && Equals(other); + /// + public bool Equals(ZoneType 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionData.Serialization.cs new file mode 100644 index 000000000000..fd6c97b590fd --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class OracleSubscriptionData : 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(OracleSubscriptionData)} 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(Plan)) + { + writer.WritePropertyName("plan"u8); + JsonSerializer.Serialize(writer, Plan); + } + } + + OracleSubscriptionData 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(OracleSubscriptionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOracleSubscriptionData(document.RootElement, options); + } + + internal static OracleSubscriptionData DeserializeOracleSubscriptionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OracleSubscriptionProperties properties = default; + ArmPlan plan = 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 = OracleSubscriptionProperties.DeserializeOracleSubscriptionProperties(property.Value, options); + continue; + } + if (property.NameEquals("plan"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + plan = 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 OracleSubscriptionData( + id, + name, + type, + systemData, + properties, + plan, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OracleSubscriptionData)} does not support writing '{options.Format}' format."); + } + } + + OracleSubscriptionData 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 DeserializeOracleSubscriptionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OracleSubscriptionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionData.cs new file mode 100644 index 000000000000..7e82204b896b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the OracleSubscription data model. + /// OracleSubscription resource definition + /// + public partial class OracleSubscriptionData : 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 OracleSubscriptionData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Details of the resource plan. + /// Keeps track of any properties unknown to the library. + internal OracleSubscriptionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, OracleSubscriptionProperties properties, ArmPlan plan, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + Plan = plan; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public OracleSubscriptionProperties Properties { get; set; } + /// Details of the resource plan. + public ArmPlan Plan { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionResource.Serialization.cs new file mode 100644 index 000000000000..ba0b6b83d075 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionResource.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.OracleDatabase +{ + public partial class OracleSubscriptionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + OracleSubscriptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + OracleSubscriptionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionResource.cs new file mode 100644 index 000000000000..49354d62bef1 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/OracleSubscriptionResource.cs @@ -0,0 +1,782 @@ +// 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.OracleDatabase.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing an OracleSubscription along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetOracleSubscriptionResource method. + /// Otherwise you can get one from its parent resource using the GetOracleSubscription method. + /// + public partial class OracleSubscriptionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _oracleSubscriptionClientDiagnostics; + private readonly OracleSubscriptionsRestOperations _oracleSubscriptionRestClient; + private readonly OracleSubscriptionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/oracleSubscriptions"; + + /// Initializes a new instance of the class for mocking. + protected OracleSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal OracleSubscriptionResource(ArmClient client, OracleSubscriptionData 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 OracleSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _oracleSubscriptionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string oracleSubscriptionApiVersion); + _oracleSubscriptionRestClient = new OracleSubscriptionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, oracleSubscriptionApiVersion); +#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 OracleSubscriptionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a OracleSubscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default + /// + /// + /// Operation Id + /// OracleSubscription_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.Get"); + scope.Start(); + try + { + var response = await _oracleSubscriptionRestClient.GetAsync(Id.SubscriptionId, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new OracleSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a OracleSubscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default + /// + /// + /// Operation Id + /// OracleSubscription_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.Get"); + scope.Start(); + try + { + var response = _oracleSubscriptionRestClient.Get(Id.SubscriptionId, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new OracleSubscriptionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a OracleSubscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default + /// + /// + /// Operation Id + /// OracleSubscription_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.Delete"); + scope.Start(); + try + { + var response = await _oracleSubscriptionRestClient.DeleteAsync(Id.SubscriptionId, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateDeleteRequest(Id.SubscriptionId).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a OracleSubscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default + /// + /// + /// Operation Id + /// OracleSubscription_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.Delete"); + scope.Start(); + try + { + var response = _oracleSubscriptionRestClient.Delete(Id.SubscriptionId, cancellationToken); + var operation = new OracleDatabaseArmOperation(_oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateDeleteRequest(Id.SubscriptionId).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a OracleSubscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default + /// + /// + /// Operation Id + /// OracleSubscription_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, OracleSubscriptionPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.Update"); + scope.Start(); + try + { + var response = await _oracleSubscriptionRestClient.UpdateAsync(Id.SubscriptionId, patch, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new OracleSubscriptionOperationSource(Client), _oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateUpdateRequest(Id.SubscriptionId, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a OracleSubscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default + /// + /// + /// Operation Id + /// OracleSubscription_Update + /// + /// + /// Default Api Version + /// 2025-03-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 resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, OracleSubscriptionPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.Update"); + scope.Start(); + try + { + var response = _oracleSubscriptionRestClient.Update(Id.SubscriptionId, patch, cancellationToken); + var operation = new OracleDatabaseArmOperation(new OracleSubscriptionOperationSource(Client), _oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateUpdateRequest(Id.SubscriptionId, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a OracleSubscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default + /// + /// + /// Operation Id + /// OracleSubscription_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, OracleSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _oracleSubscriptionRestClient.CreateOrUpdateAsync(Id.SubscriptionId, data, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new OracleSubscriptionOperationSource(Client), _oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a OracleSubscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default + /// + /// + /// Operation Id + /// OracleSubscription_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, OracleSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = _oracleSubscriptionRestClient.CreateOrUpdate(Id.SubscriptionId, data, cancellationToken); + var operation = new OracleDatabaseArmOperation(new OracleSubscriptionOperationSource(Client), _oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Cloud Account Details + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listCloudAccountDetails + /// + /// + /// Operation Id + /// OracleSubscriptions_ListCloudAccountDetails + /// + /// + /// Default Api Version + /// 2025-03-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 GetCloudAccountDetailsAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.GetCloudAccountDetails"); + scope.Start(); + try + { + var response = await _oracleSubscriptionRestClient.ListCloudAccountDetailsAsync(Id.SubscriptionId, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateListCloudAccountDetailsRequest(Id.SubscriptionId).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Cloud Account Details + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listCloudAccountDetails + /// + /// + /// Operation Id + /// OracleSubscriptions_ListCloudAccountDetails + /// + /// + /// Default Api Version + /// 2025-03-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 GetCloudAccountDetails(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.GetCloudAccountDetails"); + scope.Start(); + try + { + var response = _oracleSubscriptionRestClient.ListCloudAccountDetails(Id.SubscriptionId, cancellationToken); + var operation = new OracleDatabaseArmOperation(_oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateListCloudAccountDetailsRequest(Id.SubscriptionId).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Saas Subscription Details + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listSaasSubscriptionDetails + /// + /// + /// Operation Id + /// OracleSubscriptions_ListSaasSubscriptionDetails + /// + /// + /// Default Api Version + /// 2025-03-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 GetSaasSubscriptionDetailsAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.GetSaasSubscriptionDetails"); + scope.Start(); + try + { + var response = await _oracleSubscriptionRestClient.ListSaasSubscriptionDetailsAsync(Id.SubscriptionId, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateListSaasSubscriptionDetailsRequest(Id.SubscriptionId).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Saas Subscription Details + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listSaasSubscriptionDetails + /// + /// + /// Operation Id + /// OracleSubscriptions_ListSaasSubscriptionDetails + /// + /// + /// Default Api Version + /// 2025-03-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 GetSaasSubscriptionDetails(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.GetSaasSubscriptionDetails"); + scope.Start(); + try + { + var response = _oracleSubscriptionRestClient.ListSaasSubscriptionDetails(Id.SubscriptionId, cancellationToken); + var operation = new OracleDatabaseArmOperation(_oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateListSaasSubscriptionDetailsRequest(Id.SubscriptionId).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Activation Links + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listActivationLinks + /// + /// + /// Operation Id + /// OracleSubscriptions_ListActivationLinks + /// + /// + /// Default Api Version + /// 2025-03-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 GetActivationLinksAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.GetActivationLinks"); + scope.Start(); + try + { + var response = await _oracleSubscriptionRestClient.ListActivationLinksAsync(Id.SubscriptionId, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateListActivationLinksRequest(Id.SubscriptionId).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Activation Links + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/listActivationLinks + /// + /// + /// Operation Id + /// OracleSubscriptions_ListActivationLinks + /// + /// + /// Default Api Version + /// 2025-03-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 GetActivationLinks(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.GetActivationLinks"); + scope.Start(); + try + { + var response = _oracleSubscriptionRestClient.ListActivationLinks(Id.SubscriptionId, cancellationToken); + var operation = new OracleDatabaseArmOperation(_oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateListActivationLinksRequest(Id.SubscriptionId).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add Azure Subscriptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/addAzureSubscriptions + /// + /// + /// Operation Id + /// OracleSubscriptions_AddAzureSubscriptions + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task AddAzureSubscriptionsAsync(WaitUntil waitUntil, AzureSubscriptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.AddAzureSubscriptions"); + scope.Start(); + try + { + var response = await _oracleSubscriptionRestClient.AddAzureSubscriptionsAsync(Id.SubscriptionId, body, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateAddAzureSubscriptionsRequest(Id.SubscriptionId, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add Azure Subscriptions + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/oracleSubscriptions/default/addAzureSubscriptions + /// + /// + /// Operation Id + /// OracleSubscriptions_AddAzureSubscriptions + /// + /// + /// Default Api Version + /// 2025-03-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 content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation AddAzureSubscriptions(WaitUntil waitUntil, AzureSubscriptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _oracleSubscriptionClientDiagnostics.CreateScope("OracleSubscriptionResource.AddAzureSubscriptions"); + scope.Start(); + try + { + var response = _oracleSubscriptionRestClient.AddAzureSubscriptions(Id.SubscriptionId, body, cancellationToken); + var operation = new OracleDatabaseArmOperation(_oracleSubscriptionClientDiagnostics, Pipeline, _oracleSubscriptionRestClient.CreateAddAzureSubscriptionsRequest(Id.SubscriptionId, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ProviderConstants.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..04122ef70d65 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/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.OracleDatabase +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseBackupsRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseBackupsRestOperations.cs new file mode 100644 index 000000000000..50f3913bc3b1 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseBackupsRestOperations.cs @@ -0,0 +1,613 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class AutonomousDatabaseBackupsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AutonomousDatabaseBackupsRestOperations. + /// 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 AutonomousDatabaseBackupsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename, string adbbackupid, AutonomousDatabaseBackupData 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/autonomousDatabaseBackups/", false); + uri.AppendPath(adbbackupid, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename, string adbbackupid, AutonomousDatabaseBackupData 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/autonomousDatabaseBackups/", false); + uri.AppendPath(adbbackupid, 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 AutonomousDatabaseBackup. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// AutonomousDatabaseBackup id. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string autonomousdatabasename, string adbbackupid, AutonomousDatabaseBackupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, autonomousdatabasename, adbbackupid, 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); + } + } + + /// Create a AutonomousDatabaseBackup. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// AutonomousDatabaseBackup id. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string autonomousdatabasename, string adbbackupid, AutonomousDatabaseBackupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, autonomousdatabasename, adbbackupid, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename, string adbbackupid) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/autonomousDatabaseBackups/", false); + uri.AppendPath(adbbackupid, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename, string adbbackupid) + { + 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/autonomousDatabaseBackups/", false); + uri.AppendPath(adbbackupid, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AutonomousDatabaseBackup. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// AutonomousDatabaseBackup id. + /// 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 autonomousdatabasename, string adbbackupid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, autonomousdatabasename, adbbackupid); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseBackupData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseBackupData.DeserializeAutonomousDatabaseBackupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutonomousDatabaseBackupData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AutonomousDatabaseBackup. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// AutonomousDatabaseBackup id. + /// 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 autonomousdatabasename, string adbbackupid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, autonomousdatabasename, adbbackupid); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseBackupData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseBackupData.DeserializeAutonomousDatabaseBackupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutonomousDatabaseBackupData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename, string adbbackupid) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/autonomousDatabaseBackups/", false); + uri.AppendPath(adbbackupid, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename, string adbbackupid) + { + 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/autonomousDatabaseBackups/", false); + uri.AppendPath(adbbackupid, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a AutonomousDatabaseBackup. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// AutonomousDatabaseBackup id. + /// 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 autonomousdatabasename, string adbbackupid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, autonomousdatabasename, adbbackupid); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a AutonomousDatabaseBackup. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// AutonomousDatabaseBackup id. + /// 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 autonomousdatabasename, string adbbackupid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, autonomousdatabasename, adbbackupid); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename, string adbbackupid, AutonomousDatabaseBackupData 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/autonomousDatabaseBackups/", false); + uri.AppendPath(adbbackupid, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename, string adbbackupid, AutonomousDatabaseBackupData data) + { + 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/autonomousDatabaseBackups/", false); + uri.AppendPath(adbbackupid, 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; + } + + /// Update a AutonomousDatabaseBackup. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// AutonomousDatabaseBackup id. + /// The resource properties to be updated. + /// 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 autonomousdatabasename, string adbbackupid, AutonomousDatabaseBackupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, autonomousdatabasename, adbbackupid, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a AutonomousDatabaseBackup. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// AutonomousDatabaseBackup id. + /// The resource properties to be updated. + /// 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 autonomousdatabasename, string adbbackupid, AutonomousDatabaseBackupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNullOrEmpty(adbbackupid, nameof(adbbackupid)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, autonomousdatabasename, adbbackupid, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/autonomousDatabaseBackups", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename) + { + 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/autonomousDatabaseBackups", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutonomousDatabaseBackup resources by AutonomousDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentAsync(string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, autonomousdatabasename); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseBackupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseBackupListResult.DeserializeAutonomousDatabaseBackupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutonomousDatabaseBackup resources by AutonomousDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParent(string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, autonomousdatabasename); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseBackupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseBackupListResult.DeserializeAutonomousDatabaseBackupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string autonomousdatabasename) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string autonomousdatabasename) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutonomousDatabaseBackup resources by AutonomousDatabase. + /// 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 database name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, autonomousdatabasename); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseBackupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseBackupListResult.DeserializeAutonomousDatabaseBackupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutonomousDatabaseBackup resources by AutonomousDatabase. + /// 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 database name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, autonomousdatabasename); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseBackupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseBackupListResult.DeserializeAutonomousDatabaseBackupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseCharacterSetsRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseCharacterSetsRestOperations.cs new file mode 100644 index 000000000000..4859aba3864f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseCharacterSetsRestOperations.cs @@ -0,0 +1,295 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class AutonomousDatabaseCharacterSetsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AutonomousDatabaseCharacterSetsRestOperations. + /// 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 AutonomousDatabaseCharacterSetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string adbscharsetname) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/autonomousDatabaseCharacterSets/", false); + uri.AppendPath(adbscharsetname, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string adbscharsetname) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/autonomousDatabaseCharacterSets/", false); + uri.AppendPath(adbscharsetname, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AutonomousDatabaseCharacterSet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// AutonomousDatabaseCharacterSet 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, AzureLocation location, string adbscharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(adbscharsetname, nameof(adbscharsetname)); + + using var message = CreateGetRequest(subscriptionId, location, adbscharsetname); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseCharacterSetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseCharacterSetData.DeserializeAutonomousDatabaseCharacterSetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutonomousDatabaseCharacterSetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AutonomousDatabaseCharacterSet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// AutonomousDatabaseCharacterSet 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, AzureLocation location, string adbscharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(adbscharsetname, nameof(adbscharsetname)); + + using var message = CreateGetRequest(subscriptionId, location, adbscharsetname); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseCharacterSetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseCharacterSetData.DeserializeAutonomousDatabaseCharacterSetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutonomousDatabaseCharacterSetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationRequestUri(string subscriptionId, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/autonomousDatabaseCharacterSets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLocation location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/autonomousDatabaseCharacterSets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseCharacterSetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseCharacterSetListResult.DeserializeAutonomousDatabaseCharacterSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocation(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseCharacterSetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseCharacterSetListResult.DeserializeAutonomousDatabaseCharacterSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string subscriptionId, AzureLocation location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseCharacterSetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseCharacterSetListResult.DeserializeAutonomousDatabaseCharacterSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutonomousDatabaseCharacterSet resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocationNextPage(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseCharacterSetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseCharacterSetListResult.DeserializeAutonomousDatabaseCharacterSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseNationalCharacterSetsRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseNationalCharacterSetsRestOperations.cs new file mode 100644 index 000000000000..02bfbe6147ab --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseNationalCharacterSetsRestOperations.cs @@ -0,0 +1,295 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class AutonomousDatabaseNationalCharacterSetsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AutonomousDatabaseNationalCharacterSetsRestOperations. + /// 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 AutonomousDatabaseNationalCharacterSetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string adbsncharsetname) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/autonomousDatabaseNationalCharacterSets/", false); + uri.AppendPath(adbsncharsetname, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string adbsncharsetname) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/autonomousDatabaseNationalCharacterSets/", false); + uri.AppendPath(adbsncharsetname, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AutonomousDatabaseNationalCharacterSet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// AutonomousDatabaseNationalCharacterSets 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, AzureLocation location, string adbsncharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(adbsncharsetname, nameof(adbsncharsetname)); + + using var message = CreateGetRequest(subscriptionId, location, adbsncharsetname); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseNationalCharacterSetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseNationalCharacterSetData.DeserializeAutonomousDatabaseNationalCharacterSetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutonomousDatabaseNationalCharacterSetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AutonomousDatabaseNationalCharacterSet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// AutonomousDatabaseNationalCharacterSets 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, AzureLocation location, string adbsncharsetname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(adbsncharsetname, nameof(adbsncharsetname)); + + using var message = CreateGetRequest(subscriptionId, location, adbsncharsetname); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseNationalCharacterSetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseNationalCharacterSetData.DeserializeAutonomousDatabaseNationalCharacterSetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutonomousDatabaseNationalCharacterSetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationRequestUri(string subscriptionId, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/autonomousDatabaseNationalCharacterSets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLocation location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/autonomousDatabaseNationalCharacterSets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseNationalCharacterSetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseNationalCharacterSetListResult.DeserializeAutonomousDatabaseNationalCharacterSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocation(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseNationalCharacterSetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseNationalCharacterSetListResult.DeserializeAutonomousDatabaseNationalCharacterSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string subscriptionId, AzureLocation location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseNationalCharacterSetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseNationalCharacterSetListResult.DeserializeAutonomousDatabaseNationalCharacterSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutonomousDatabaseNationalCharacterSet resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocationNextPage(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseNationalCharacterSetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseNationalCharacterSetListResult.DeserializeAutonomousDatabaseNationalCharacterSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseVersionsRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseVersionsRestOperations.cs new file mode 100644 index 000000000000..abc8585251cf --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabaseVersionsRestOperations.cs @@ -0,0 +1,295 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class AutonomousDatabaseVersionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AutonomousDatabaseVersionsRestOperations. + /// 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 AutonomousDatabaseVersionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string autonomousdbversionsname) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/autonomousDbVersions/", false); + uri.AppendPath(autonomousdbversionsname, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string autonomousdbversionsname) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/autonomousDbVersions/", false); + uri.AppendPath(autonomousdbversionsname, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AutonomousDbVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// AutonomousDbVersion 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, AzureLocation location, string autonomousdbversionsname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(autonomousdbversionsname, nameof(autonomousdbversionsname)); + + using var message = CreateGetRequest(subscriptionId, location, autonomousdbversionsname); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDbVersionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDbVersionData.DeserializeAutonomousDbVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutonomousDbVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AutonomousDbVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// AutonomousDbVersion 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, AzureLocation location, string autonomousdbversionsname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(autonomousdbversionsname, nameof(autonomousdbversionsname)); + + using var message = CreateGetRequest(subscriptionId, location, autonomousdbversionsname); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDbVersionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDbVersionData.DeserializeAutonomousDbVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutonomousDbVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationRequestUri(string subscriptionId, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/autonomousDbVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLocation location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/autonomousDbVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutonomousDbVersion resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDbVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDbVersionListResult.DeserializeAutonomousDbVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutonomousDbVersion resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocation(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDbVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDbVersionListResult.DeserializeAutonomousDbVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string subscriptionId, AzureLocation location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutonomousDbVersion resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDbVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDbVersionListResult.DeserializeAutonomousDbVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutonomousDbVersion resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocationNextPage(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDbVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDbVersionListResult.DeserializeAutonomousDbVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabasesRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabasesRestOperations.cs new file mode 100644 index 000000000000..87100faadda5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/AutonomousDatabasesRestOperations.cs @@ -0,0 +1,1287 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class AutonomousDatabasesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AutonomousDatabasesRestOperations. + /// 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 AutonomousDatabasesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases", 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/Oracle.Database/autonomousDatabases", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutonomousDatabase resources by subscription ID. + /// 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: + { + AutonomousDatabaseListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseListResult.DeserializeAutonomousDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutonomousDatabase resources by subscription ID. + /// 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: + { + AutonomousDatabaseListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseListResult.DeserializeAutonomousDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename, AutonomousDatabaseData 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename, AutonomousDatabaseData 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, 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 AutonomousDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string autonomousdatabasename, AutonomousDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, autonomousdatabasename, 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); + } + } + + /// Create a AutonomousDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string autonomousdatabasename, AutonomousDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, autonomousdatabasename, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename) + { + 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AutonomousDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, autonomousdatabasename); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseData.DeserializeAutonomousDatabaseData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutonomousDatabaseData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AutonomousDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database 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 autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, autonomousdatabasename); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseData.DeserializeAutonomousDatabaseData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutonomousDatabaseData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename, AutonomousDatabasePatch 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename, AutonomousDatabasePatch 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, 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; + } + + /// Update a AutonomousDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The resource properties to be updated. + /// 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 autonomousdatabasename, AutonomousDatabasePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, autonomousdatabasename, 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); + } + } + + /// Update a AutonomousDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The resource properties to be updated. + /// 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 autonomousdatabasename, AutonomousDatabasePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, autonomousdatabasename, 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 autonomousdatabasename) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename) + { + 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a AutonomousDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, autonomousdatabasename); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a AutonomousDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database 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 autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, autonomousdatabasename); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutonomousDatabase resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseListResult.DeserializeAutonomousDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutonomousDatabase resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseListResult.DeserializeAutonomousDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateSwitchoverRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename, PeerDbDetails details) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/switchover", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateSwitchoverRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename, PeerDbDetails details) + { + 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/switchover", 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(details, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Perform switchover action on Autonomous Database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task SwitchoverAsync(string subscriptionId, string resourceGroupName, string autonomousdatabasename, PeerDbDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateSwitchoverRequest(subscriptionId, resourceGroupName, autonomousdatabasename, details); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Perform switchover action on Autonomous Database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Switchover(string subscriptionId, string resourceGroupName, string autonomousdatabasename, PeerDbDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateSwitchoverRequest(subscriptionId, resourceGroupName, autonomousdatabasename, details); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateFailoverRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename, PeerDbDetails details) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/failover", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateFailoverRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename, PeerDbDetails details) + { + 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/failover", 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(details, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Perform failover action on Autonomous Database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task FailoverAsync(string subscriptionId, string resourceGroupName, string autonomousdatabasename, PeerDbDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateFailoverRequest(subscriptionId, resourceGroupName, autonomousdatabasename, details); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Perform failover action on Autonomous Database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Failover(string subscriptionId, string resourceGroupName, string autonomousdatabasename, PeerDbDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateFailoverRequest(subscriptionId, resourceGroupName, autonomousdatabasename, details); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGenerateWalletRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename, GenerateAutonomousDatabaseWalletDetails details) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/generateWallet", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGenerateWalletRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename, GenerateAutonomousDatabaseWalletDetails details) + { + 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/generateWallet", 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(details, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Generate wallet action on Autonomous Database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GenerateWalletAsync(string subscriptionId, string resourceGroupName, string autonomousdatabasename, GenerateAutonomousDatabaseWalletDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateGenerateWalletRequest(subscriptionId, resourceGroupName, autonomousdatabasename, details); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseWalletFile value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseWalletFile.DeserializeAutonomousDatabaseWalletFile(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Generate wallet action on Autonomous Database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GenerateWallet(string subscriptionId, string resourceGroupName, string autonomousdatabasename, GenerateAutonomousDatabaseWalletDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateGenerateWalletRequest(subscriptionId, resourceGroupName, autonomousdatabasename, details); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseWalletFile value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseWalletFile.DeserializeAutonomousDatabaseWalletFile(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRestoreRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename, RestoreAutonomousDatabaseDetails details) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/restore", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRestoreRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename, RestoreAutonomousDatabaseDetails details) + { + 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/restore", 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(details, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Restores an Autonomous Database based on the provided request parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task RestoreAsync(string subscriptionId, string resourceGroupName, string autonomousdatabasename, RestoreAutonomousDatabaseDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateRestoreRequest(subscriptionId, resourceGroupName, autonomousdatabasename, details); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Restores an Autonomous Database based on the provided request parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Restore(string subscriptionId, string resourceGroupName, string autonomousdatabasename, RestoreAutonomousDatabaseDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateRestoreRequest(subscriptionId, resourceGroupName, autonomousdatabasename, details); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateShrinkRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/shrink", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateShrinkRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename) + { + 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/shrink", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// This operation shrinks the current allocated storage down to the current actual used data storage. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task ShrinkAsync(string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var message = CreateShrinkRequest(subscriptionId, resourceGroupName, autonomousdatabasename); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// This operation shrinks the current allocated storage down to the current actual used data storage. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Shrink(string subscriptionId, string resourceGroupName, string autonomousdatabasename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + + using var message = CreateShrinkRequest(subscriptionId, resourceGroupName, autonomousdatabasename); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateChangeDisasterRecoveryConfigurationRequestUri(string subscriptionId, string resourceGroupName, string autonomousdatabasename, DisasterRecoveryConfigurationDetails details) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/changeDisasterRecoveryConfiguration", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateChangeDisasterRecoveryConfigurationRequest(string subscriptionId, string resourceGroupName, string autonomousdatabasename, DisasterRecoveryConfigurationDetails details) + { + 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/Oracle.Database/autonomousDatabases/", false); + uri.AppendPath(autonomousdatabasename, true); + uri.AppendPath("/changeDisasterRecoveryConfiguration", 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(details, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task ChangeDisasterRecoveryConfigurationAsync(string subscriptionId, string resourceGroupName, string autonomousdatabasename, DisasterRecoveryConfigurationDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateChangeDisasterRecoveryConfigurationRequest(subscriptionId, resourceGroupName, autonomousdatabasename, details); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Perform ChangeDisasterRecoveryConfiguration action on Autonomous Database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The database name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ChangeDisasterRecoveryConfiguration(string subscriptionId, string resourceGroupName, string autonomousdatabasename, DisasterRecoveryConfigurationDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(autonomousdatabasename, nameof(autonomousdatabasename)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateChangeDisasterRecoveryConfigurationRequest(subscriptionId, resourceGroupName, autonomousdatabasename, details); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return 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; + } + + /// List AutonomousDatabase resources by subscription ID. + /// 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: + { + AutonomousDatabaseListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseListResult.DeserializeAutonomousDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutonomousDatabase resources by subscription ID. + /// 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: + { + AutonomousDatabaseListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseListResult.DeserializeAutonomousDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutonomousDatabase resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = AutonomousDatabaseListResult.DeserializeAutonomousDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutonomousDatabase resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutonomousDatabaseListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = AutonomousDatabaseListResult.DeserializeAutonomousDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudExadataInfrastructuresRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudExadataInfrastructuresRestOperations.cs new file mode 100644 index 000000000000..8c2023d85672 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudExadataInfrastructuresRestOperations.cs @@ -0,0 +1,809 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class CloudExadataInfrastructuresRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CloudExadataInfrastructuresRestOperations. + /// 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 CloudExadataInfrastructuresRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/cloudExadataInfrastructures", 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/Oracle.Database/cloudExadataInfrastructures", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List CloudExadataInfrastructure resources by subscription ID. + /// 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: + { + CloudExadataInfrastructureListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CloudExadataInfrastructureListResult.DeserializeCloudExadataInfrastructureListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List CloudExadataInfrastructure resources by subscription ID. + /// 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: + { + CloudExadataInfrastructureListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CloudExadataInfrastructureListResult.DeserializeCloudExadataInfrastructureListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CloudExadataInfrastructureData 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/Oracle.Database/cloudExadataInfrastructures/", false); + uri.AppendPath(cloudexadatainfrastructurename, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CloudExadataInfrastructureData 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/Oracle.Database/cloudExadataInfrastructures/", false); + uri.AppendPath(cloudexadatainfrastructurename, 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 CloudExadataInfrastructure. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudExadataInfrastructure name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CloudExadataInfrastructureData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename, 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); + } + } + + /// Create a CloudExadataInfrastructure. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudExadataInfrastructure name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CloudExadataInfrastructureData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudExadataInfrastructures/", false); + uri.AppendPath(cloudexadatainfrastructurename, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) + { + 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/Oracle.Database/cloudExadataInfrastructures/", false); + uri.AppendPath(cloudexadatainfrastructurename, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a CloudExadataInfrastructure. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudExadataInfrastructure 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 cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CloudExadataInfrastructureData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CloudExadataInfrastructureData.DeserializeCloudExadataInfrastructureData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CloudExadataInfrastructureData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a CloudExadataInfrastructure. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudExadataInfrastructure 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 cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CloudExadataInfrastructureData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CloudExadataInfrastructureData.DeserializeCloudExadataInfrastructureData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CloudExadataInfrastructureData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CloudExadataInfrastructurePatch 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/Oracle.Database/cloudExadataInfrastructures/", false); + uri.AppendPath(cloudexadatainfrastructurename, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CloudExadataInfrastructurePatch 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/Oracle.Database/cloudExadataInfrastructures/", false); + uri.AppendPath(cloudexadatainfrastructurename, 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; + } + + /// Update a CloudExadataInfrastructure. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudExadataInfrastructure name. + /// The resource properties to be updated. + /// 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 cloudexadatainfrastructurename, CloudExadataInfrastructurePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename, 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); + } + } + + /// Update a CloudExadataInfrastructure. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudExadataInfrastructure name. + /// The resource properties to be updated. + /// 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 cloudexadatainfrastructurename, CloudExadataInfrastructurePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename, 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 cloudexadatainfrastructurename) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudExadataInfrastructures/", false); + uri.AppendPath(cloudexadatainfrastructurename, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) + { + 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/Oracle.Database/cloudExadataInfrastructures/", false); + uri.AppendPath(cloudexadatainfrastructurename, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a CloudExadataInfrastructure. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudExadataInfrastructure 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 cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a CloudExadataInfrastructure. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudExadataInfrastructure 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 cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudExadataInfrastructures", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudExadataInfrastructures", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List CloudExadataInfrastructure resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CloudExadataInfrastructureListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CloudExadataInfrastructureListResult.DeserializeCloudExadataInfrastructureListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List CloudExadataInfrastructure resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CloudExadataInfrastructureListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CloudExadataInfrastructureListResult.DeserializeCloudExadataInfrastructureListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateAddStorageCapacityRequestUri(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudExadataInfrastructures/", false); + uri.AppendPath(cloudexadatainfrastructurename, true); + uri.AppendPath("/addStorageCapacity", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateAddStorageCapacityRequest(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) + { + 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/Oracle.Database/cloudExadataInfrastructures/", false); + uri.AppendPath(cloudexadatainfrastructurename, true); + uri.AppendPath("/addStorageCapacity", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Perform add storage capacity on exadata infra. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudExadataInfrastructure name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task AddStorageCapacityAsync(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var message = CreateAddStorageCapacityRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Perform add storage capacity on exadata infra. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudExadataInfrastructure name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response AddStorageCapacity(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var message = CreateAddStorageCapacityRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return 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; + } + + /// List CloudExadataInfrastructure resources by subscription ID. + /// 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: + { + CloudExadataInfrastructureListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CloudExadataInfrastructureListResult.DeserializeCloudExadataInfrastructureListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List CloudExadataInfrastructure resources by subscription ID. + /// 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: + { + CloudExadataInfrastructureListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CloudExadataInfrastructureListResult.DeserializeCloudExadataInfrastructureListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List CloudExadataInfrastructure resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CloudExadataInfrastructureListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CloudExadataInfrastructureListResult.DeserializeCloudExadataInfrastructureListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List CloudExadataInfrastructure resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CloudExadataInfrastructureListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CloudExadataInfrastructureListResult.DeserializeCloudExadataInfrastructureListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudVmClustersRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudVmClustersRestOperations.cs new file mode 100644 index 000000000000..dd178ebae702 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/CloudVmClustersRestOperations.cs @@ -0,0 +1,1024 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class CloudVmClustersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CloudVmClustersRestOperations. + /// 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 CloudVmClustersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/cloudVmClusters", 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/Oracle.Database/cloudVmClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List CloudVmCluster resources by subscription ID. + /// 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: + { + CloudVmClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CloudVmClusterListResult.DeserializeCloudVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List CloudVmCluster resources by subscription ID. + /// 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: + { + CloudVmClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CloudVmClusterListResult.DeserializeCloudVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername, CloudVmClusterData 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername, CloudVmClusterData 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, 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 CloudVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string cloudvmclustername, CloudVmClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, cloudvmclustername, 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); + } + } + + /// Create a CloudVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string cloudvmclustername, CloudVmClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, cloudvmclustername, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername) + { + 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a CloudVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster 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 cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, cloudvmclustername); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CloudVmClusterData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CloudVmClusterData.DeserializeCloudVmClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CloudVmClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a CloudVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster 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 cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, cloudvmclustername); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CloudVmClusterData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CloudVmClusterData.DeserializeCloudVmClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CloudVmClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername, CloudVmClusterPatch 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername, CloudVmClusterPatch 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, 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; + } + + /// Update a CloudVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// The resource properties to be updated. + /// 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 cloudvmclustername, CloudVmClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, cloudvmclustername, 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); + } + } + + /// Update a CloudVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// The resource properties to be updated. + /// 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 cloudvmclustername, CloudVmClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, cloudvmclustername, 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 cloudvmclustername) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername) + { + 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a CloudVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster 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 cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, cloudvmclustername); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a CloudVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster 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 cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, cloudvmclustername); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudVmClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudVmClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List CloudVmCluster resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CloudVmClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CloudVmClusterListResult.DeserializeCloudVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List CloudVmCluster resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CloudVmClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CloudVmClusterListResult.DeserializeCloudVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateAddVmsRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername, AddRemoveDbNode 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/addVms", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateAddVmsRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername, AddRemoveDbNode 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/addVms", 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; + } + + /// Add VMs to the VM Cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task AddVmsAsync(string subscriptionId, string resourceGroupName, string cloudvmclustername, AddRemoveDbNode body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateAddVmsRequest(subscriptionId, resourceGroupName, cloudvmclustername, 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); + } + } + + /// Add VMs to the VM Cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response AddVms(string subscriptionId, string resourceGroupName, string cloudvmclustername, AddRemoveDbNode body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateAddVmsRequest(subscriptionId, resourceGroupName, cloudvmclustername, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRemoveVmsRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername, AddRemoveDbNode 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/removeVms", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRemoveVmsRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername, AddRemoveDbNode 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/removeVms", 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; + } + + /// Remove VMs from the VM Cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task RemoveVmsAsync(string subscriptionId, string resourceGroupName, string cloudvmclustername, AddRemoveDbNode body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateRemoveVmsRequest(subscriptionId, resourceGroupName, cloudvmclustername, 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); + } + } + + /// Remove VMs from the VM Cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response RemoveVms(string subscriptionId, string resourceGroupName, string cloudvmclustername, AddRemoveDbNode body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateRemoveVmsRequest(subscriptionId, resourceGroupName, cloudvmclustername, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListPrivateIPAddressesRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername, PrivateIPAddressesFilter 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/listPrivateIpAddresses", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListPrivateIPAddressesRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername, PrivateIPAddressesFilter 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/listPrivateIpAddresses", 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; + } + + /// List Private IP Addresses by the provided filter. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task>> ListPrivateIPAddressesAsync(string subscriptionId, string resourceGroupName, string cloudvmclustername, PrivateIPAddressesFilter body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateListPrivateIPAddressesRequest(subscriptionId, resourceGroupName, cloudvmclustername, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(PrivateIPAddressProperties.DeserializePrivateIPAddressProperties(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Private IP Addresses by the provided filter. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response> ListPrivateIPAddresses(string subscriptionId, string resourceGroupName, string cloudvmclustername, PrivateIPAddressesFilter body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateListPrivateIPAddressesRequest(subscriptionId, resourceGroupName, cloudvmclustername, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(PrivateIPAddressProperties.DeserializePrivateIPAddressProperties(item)); + } + value = array; + 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; + } + + /// List CloudVmCluster resources by subscription ID. + /// 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: + { + CloudVmClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CloudVmClusterListResult.DeserializeCloudVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List CloudVmCluster resources by subscription ID. + /// 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: + { + CloudVmClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CloudVmClusterListResult.DeserializeCloudVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List CloudVmCluster resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CloudVmClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CloudVmClusterListResult.DeserializeCloudVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List CloudVmCluster resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CloudVmClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CloudVmClusterListResult.DeserializeCloudVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbNodesRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbNodesRestOperations.cs new file mode 100644 index 000000000000..6028aa75cabf --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbNodesRestOperations.cs @@ -0,0 +1,423 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class DbNodesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DbNodesRestOperations. + /// 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 DbNodesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername, string dbnodeocid) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/dbNodes/", false); + uri.AppendPath(dbnodeocid, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername, string dbnodeocid) + { + 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/dbNodes/", false); + uri.AppendPath(dbnodeocid, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a DbNode. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// DbNode OCID. + /// 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 cloudvmclustername, string dbnodeocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNullOrEmpty(dbnodeocid, nameof(dbnodeocid)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, cloudvmclustername, dbnodeocid); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DbNodeData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DbNodeData.DeserializeDbNodeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DbNodeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a DbNode. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// DbNode OCID. + /// 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 cloudvmclustername, string dbnodeocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNullOrEmpty(dbnodeocid, nameof(dbnodeocid)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, cloudvmclustername, dbnodeocid); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DbNodeData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DbNodeData.DeserializeDbNodeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DbNodeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/dbNodes", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername) + { + 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/dbNodes", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DbNode resources by CloudVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentAsync(string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, cloudvmclustername); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DbNodeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DbNodeListResult.DeserializeDbNodeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DbNode resources by CloudVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParent(string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, cloudvmclustername); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DbNodeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DbNodeListResult.DeserializeDbNodeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateActionRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername, string dbnodeocid, DbNodeAction 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/dbNodes/", false); + uri.AppendPath(dbnodeocid, true); + uri.AppendPath("/action", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateActionRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername, string dbnodeocid, DbNodeAction 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/dbNodes/", false); + uri.AppendPath(dbnodeocid, true); + uri.AppendPath("/action", 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; + } + + /// VM actions on DbNode of VM Cluster by the provided filter. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// DbNode OCID. + /// The content of the action request. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task ActionAsync(string subscriptionId, string resourceGroupName, string cloudvmclustername, string dbnodeocid, DbNodeAction body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNullOrEmpty(dbnodeocid, nameof(dbnodeocid)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateActionRequest(subscriptionId, resourceGroupName, cloudvmclustername, dbnodeocid, 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); + } + } + + /// VM actions on DbNode of VM Cluster by the provided filter. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// DbNode OCID. + /// The content of the action request. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Action(string subscriptionId, string resourceGroupName, string cloudvmclustername, string dbnodeocid, DbNodeAction body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNullOrEmpty(dbnodeocid, nameof(dbnodeocid)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateActionRequest(subscriptionId, resourceGroupName, cloudvmclustername, dbnodeocid, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DbNode resources by CloudVmCluster. + /// 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. + /// CloudVmCluster name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudvmclustername); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DbNodeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DbNodeListResult.DeserializeDbNodeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DbNode resources by CloudVmCluster. + /// 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. + /// CloudVmCluster name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudvmclustername); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DbNodeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DbNodeListResult.DeserializeDbNodeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbServersRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbServersRestOperations.cs new file mode 100644 index 000000000000..71b1d9981168 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbServersRestOperations.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class DbServersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DbServersRestOperations. + /// 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 DbServersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, string dbserverocid) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudExadataInfrastructures/", false); + uri.AppendPath(cloudexadatainfrastructurename, true); + uri.AppendPath("/dbServers/", false); + uri.AppendPath(dbserverocid, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, string dbserverocid) + { + 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/Oracle.Database/cloudExadataInfrastructures/", false); + uri.AppendPath(cloudexadatainfrastructurename, true); + uri.AppendPath("/dbServers/", false); + uri.AppendPath(dbserverocid, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a DbServer. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudExadataInfrastructure name. + /// DbServer OCID. + /// 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 cloudexadatainfrastructurename, string dbserverocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + Argument.AssertNotNullOrEmpty(dbserverocid, nameof(dbserverocid)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename, dbserverocid); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DbServerData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DbServerData.DeserializeDbServerData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DbServerData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a DbServer. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudExadataInfrastructure name. + /// DbServer OCID. + /// 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 cloudexadatainfrastructurename, string dbserverocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + Argument.AssertNotNullOrEmpty(dbserverocid, nameof(dbserverocid)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename, dbserverocid); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DbServerData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DbServerData.DeserializeDbServerData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DbServerData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudExadataInfrastructures/", false); + uri.AppendPath(cloudexadatainfrastructurename, true); + uri.AppendPath("/dbServers", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) + { + 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/Oracle.Database/cloudExadataInfrastructures/", false); + uri.AppendPath(cloudexadatainfrastructurename, true); + uri.AppendPath("/dbServers", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DbServer resources by CloudExadataInfrastructure. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudExadataInfrastructure name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentAsync(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DbServerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DbServerListResult.DeserializeDbServerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DbServer resources by CloudExadataInfrastructure. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudExadataInfrastructure name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParent(string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DbServerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DbServerListResult.DeserializeDbServerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DbServer resources by CloudExadataInfrastructure. + /// 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. + /// CloudExadataInfrastructure name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DbServerListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DbServerListResult.DeserializeDbServerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DbServer resources by CloudExadataInfrastructure. + /// 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. + /// CloudExadataInfrastructure name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string cloudexadatainfrastructurename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudexadatainfrastructurename, nameof(cloudexadatainfrastructurename)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudexadatainfrastructurename); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DbServerListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DbServerListResult.DeserializeDbServerListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbSystemShapesRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbSystemShapesRestOperations.cs new file mode 100644 index 000000000000..0b8d2443df5b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DbSystemShapesRestOperations.cs @@ -0,0 +1,307 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class DbSystemShapesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DbSystemShapesRestOperations. + /// 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 DbSystemShapesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string dbsystemshapename) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dbSystemShapes/", false); + uri.AppendPath(dbsystemshapename, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string dbsystemshapename) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dbSystemShapes/", false); + uri.AppendPath(dbsystemshapename, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a DbSystemShape. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// DbSystemShape 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, AzureLocation location, string dbsystemshapename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(dbsystemshapename, nameof(dbsystemshapename)); + + using var message = CreateGetRequest(subscriptionId, location, dbsystemshapename); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DbSystemShapeData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DbSystemShapeData.DeserializeDbSystemShapeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DbSystemShapeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a DbSystemShape. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// DbSystemShape 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, AzureLocation location, string dbsystemshapename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(dbsystemshapename, nameof(dbsystemshapename)); + + using var message = CreateGetRequest(subscriptionId, location, dbsystemshapename); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DbSystemShapeData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DbSystemShapeData.DeserializeDbSystemShapeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DbSystemShapeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationRequestUri(string subscriptionId, AzureLocation location, string zone) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dbSystemShapes", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (zone != null) + { + uri.AppendQuery("zone", zone, true); + } + return uri; + } + + internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLocation location, string zone) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dbSystemShapes", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (zone != null) + { + uri.AppendQuery("zone", zone, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DbSystemShape resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationAsync(string subscriptionId, AzureLocation location, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location, zone); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DbSystemShapeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DbSystemShapeListResult.DeserializeDbSystemShapeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DbSystemShape resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocation(string subscriptionId, AzureLocation location, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location, zone); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DbSystemShapeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DbSystemShapeListResult.DeserializeDbSystemShapeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location, string zone) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string subscriptionId, AzureLocation location, string zone) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DbSystemShape resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location, zone); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DbSystemShapeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DbSystemShapeListResult.DeserializeDbSystemShapeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DbSystemShape resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocationNextPage(string nextLink, string subscriptionId, AzureLocation location, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location, zone); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DbSystemShapeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DbSystemShapeListResult.DeserializeDbSystemShapeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateViewsRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateViewsRestOperations.cs new file mode 100644 index 000000000000..9cebec515b85 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateViewsRestOperations.cs @@ -0,0 +1,295 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class DnsPrivateViewsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DnsPrivateViewsRestOperations. + /// 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 DnsPrivateViewsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string dnsprivateviewocid) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dnsPrivateViews/", false); + uri.AppendPath(dnsprivateviewocid, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string dnsprivateviewocid) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dnsPrivateViews/", false); + uri.AppendPath(dnsprivateviewocid, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a DnsPrivateView. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// DnsPrivateView OCID. + /// 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, AzureLocation location, string dnsprivateviewocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(dnsprivateviewocid, nameof(dnsprivateviewocid)); + + using var message = CreateGetRequest(subscriptionId, location, dnsprivateviewocid); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsPrivateViewData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DnsPrivateViewData.DeserializeDnsPrivateViewData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DnsPrivateViewData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a DnsPrivateView. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// DnsPrivateView OCID. + /// 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, AzureLocation location, string dnsprivateviewocid, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(dnsprivateviewocid, nameof(dnsprivateviewocid)); + + using var message = CreateGetRequest(subscriptionId, location, dnsprivateviewocid); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsPrivateViewData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DnsPrivateViewData.DeserializeDnsPrivateViewData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DnsPrivateViewData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationRequestUri(string subscriptionId, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dnsPrivateViews", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLocation location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dnsPrivateViews", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DnsPrivateView resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsPrivateViewListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DnsPrivateViewListResult.DeserializeDnsPrivateViewListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DnsPrivateView resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocation(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsPrivateViewListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DnsPrivateViewListResult.DeserializeDnsPrivateViewListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string subscriptionId, AzureLocation location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DnsPrivateView resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsPrivateViewListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DnsPrivateViewListResult.DeserializeDnsPrivateViewListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DnsPrivateView resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocationNextPage(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsPrivateViewListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DnsPrivateViewListResult.DeserializeDnsPrivateViewListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateZonesRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateZonesRestOperations.cs new file mode 100644 index 000000000000..9f19975be4ad --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/DnsPrivateZonesRestOperations.cs @@ -0,0 +1,295 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class DnsPrivateZonesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DnsPrivateZonesRestOperations. + /// 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 DnsPrivateZonesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string dnsprivatezonename) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dnsPrivateZones/", false); + uri.AppendPath(dnsprivatezonename, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string dnsprivatezonename) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dnsPrivateZones/", false); + uri.AppendPath(dnsprivatezonename, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a DnsPrivateZone. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// DnsPrivateZone 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, AzureLocation location, string dnsprivatezonename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(dnsprivatezonename, nameof(dnsprivatezonename)); + + using var message = CreateGetRequest(subscriptionId, location, dnsprivatezonename); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsPrivateZoneData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DnsPrivateZoneData.DeserializeDnsPrivateZoneData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DnsPrivateZoneData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a DnsPrivateZone. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// DnsPrivateZone 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, AzureLocation location, string dnsprivatezonename, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(dnsprivatezonename, nameof(dnsprivatezonename)); + + using var message = CreateGetRequest(subscriptionId, location, dnsprivatezonename); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsPrivateZoneData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DnsPrivateZoneData.DeserializeDnsPrivateZoneData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DnsPrivateZoneData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationRequestUri(string subscriptionId, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dnsPrivateZones", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLocation location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/dnsPrivateZones", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DnsPrivateZone resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsPrivateZoneListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DnsPrivateZoneListResult.DeserializeDnsPrivateZoneListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DnsPrivateZone resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocation(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsPrivateZoneListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DnsPrivateZoneListResult.DeserializeDnsPrivateZoneListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string subscriptionId, AzureLocation location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List DnsPrivateZone resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DnsPrivateZoneListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DnsPrivateZoneListResult.DeserializeDnsPrivateZoneListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List DnsPrivateZone resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocationNextPage(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DnsPrivateZoneListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DnsPrivateZoneListResult.DeserializeDnsPrivateZoneListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExadbVmClustersRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExadbVmClustersRestOperations.cs new file mode 100644 index 000000000000..2b41f881acff --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExadbVmClustersRestOperations.cs @@ -0,0 +1,817 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class ExadbVmClustersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ExadbVmClustersRestOperations. + /// 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 ExadbVmClustersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters", 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/Oracle.Database/exadbVmClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExadbVmCluster resources by subscription ID. + /// 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: + { + ExadbVmClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExadbVmCluster resources by subscription ID. + /// 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: + { + ExadbVmClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string exadbVmClusterName, ExadbVmClusterData 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName, ExadbVmClusterData 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, 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 ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string exadbVmClusterName, ExadbVmClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, exadbVmClusterName, 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); + } + } + + /// Create a ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string exadbVmClusterName, ExadbVmClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, exadbVmClusterName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// 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 exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, exadbVmClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExadbVmClusterData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExadbVmClusterData.DeserializeExadbVmClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExadbVmClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// 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 exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, exadbVmClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExadbVmClusterData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExadbVmClusterData.DeserializeExadbVmClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExadbVmClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string exadbVmClusterName, ExadbVmClusterPatch 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName, ExadbVmClusterPatch 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, 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; + } + + /// Update a ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The resource properties to be updated. + /// 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 exadbVmClusterName, ExadbVmClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, exadbVmClusterName, 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); + } + } + + /// Update a ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The resource properties to be updated. + /// 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 exadbVmClusterName, ExadbVmClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, exadbVmClusterName, 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 exadbVmClusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// 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 exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, exadbVmClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// 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 exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, exadbVmClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExadbVmCluster resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExadbVmClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExadbVmCluster resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExadbVmClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRemoveVmsRequestUri(string subscriptionId, string resourceGroupName, string exadbVmClusterName, RemoveVirtualMachineFromExadbVmClusterDetails details) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/removeVms", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRemoveVmsRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName, RemoveVirtualMachineFromExadbVmClusterDetails details) + { + 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/removeVms", 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(details, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Remove VMs from the VM Cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task RemoveVmsAsync(string subscriptionId, string resourceGroupName, string exadbVmClusterName, RemoveVirtualMachineFromExadbVmClusterDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateRemoveVmsRequest(subscriptionId, resourceGroupName, exadbVmClusterName, details); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Remove VMs from the VM Cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The content of the action request. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response RemoveVms(string subscriptionId, string resourceGroupName, string exadbVmClusterName, RemoveVirtualMachineFromExadbVmClusterDetails details, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNull(details, nameof(details)); + + using var message = CreateRemoveVmsRequest(subscriptionId, resourceGroupName, exadbVmClusterName, details); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return 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; + } + + /// List ExadbVmCluster resources by subscription ID. + /// 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: + { + ExadbVmClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExadbVmCluster resources by subscription ID. + /// 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: + { + ExadbVmClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExadbVmCluster resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExadbVmClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExadbVmCluster resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExadbVmClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExadbVmClusterListResult.DeserializeExadbVmClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbNodesRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbNodesRestOperations.cs new file mode 100644 index 000000000000..320ca8912912 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbNodesRestOperations.cs @@ -0,0 +1,423 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class ExascaleDbNodesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ExascaleDbNodesRestOperations. + /// 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 ExascaleDbNodesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string exadbVmClusterName, string exascaleDbNodeName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/dbNodes/", false); + uri.AppendPath(exascaleDbNodeName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName, string exascaleDbNodeName) + { + 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/dbNodes/", false); + uri.AppendPath(exascaleDbNodeName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a ExascaleDbNode. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The name of the ExascaleDbNode. + /// 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 exadbVmClusterName, string exascaleDbNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNullOrEmpty(exascaleDbNodeName, nameof(exascaleDbNodeName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, exadbVmClusterName, exascaleDbNodeName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExascaleDbNodeData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDbNodeData.DeserializeExascaleDbNodeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExascaleDbNodeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a ExascaleDbNode. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The name of the ExascaleDbNode. + /// 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 exadbVmClusterName, string exascaleDbNodeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNullOrEmpty(exascaleDbNodeName, nameof(exascaleDbNodeName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, exadbVmClusterName, exascaleDbNodeName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExascaleDbNodeData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDbNodeData.DeserializeExascaleDbNodeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExascaleDbNodeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/dbNodes", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/dbNodes", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExascaleDbNode resources by ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentAsync(string subscriptionId, string resourceGroupName, string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, exadbVmClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExascaleDbNodeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDbNodeListResult.DeserializeExascaleDbNodeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExascaleDbNode resources by ExadbVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParent(string subscriptionId, string resourceGroupName, string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, exadbVmClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExascaleDbNodeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDbNodeListResult.DeserializeExascaleDbNodeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateActionRequestUri(string subscriptionId, string resourceGroupName, string exadbVmClusterName, string exascaleDbNodeName, DbNodeAction 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/dbNodes/", false); + uri.AppendPath(exascaleDbNodeName, true); + uri.AppendPath("/action", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateActionRequest(string subscriptionId, string resourceGroupName, string exadbVmClusterName, string exascaleDbNodeName, DbNodeAction 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/Oracle.Database/exadbVmClusters/", false); + uri.AppendPath(exadbVmClusterName, true); + uri.AppendPath("/dbNodes/", false); + uri.AppendPath(exascaleDbNodeName, true); + uri.AppendPath("/action", 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; + } + + /// VM actions on DbNode of ExadbVmCluster by the provided filter. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The name of the ExascaleDbNode. + /// The content of the action request. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task ActionAsync(string subscriptionId, string resourceGroupName, string exadbVmClusterName, string exascaleDbNodeName, DbNodeAction body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNullOrEmpty(exascaleDbNodeName, nameof(exascaleDbNodeName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateActionRequest(subscriptionId, resourceGroupName, exadbVmClusterName, exascaleDbNodeName, 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); + } + } + + /// VM actions on DbNode of ExadbVmCluster by the provided filter. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExadbVmCluster. + /// The name of the ExascaleDbNode. + /// The content of the action request. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Action(string subscriptionId, string resourceGroupName, string exadbVmClusterName, string exascaleDbNodeName, DbNodeAction body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + Argument.AssertNotNullOrEmpty(exascaleDbNodeName, nameof(exascaleDbNodeName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateActionRequest(subscriptionId, resourceGroupName, exadbVmClusterName, exascaleDbNodeName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string exadbVmClusterName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExascaleDbNode resources by ExadbVmCluster. + /// 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 name of the ExadbVmCluster. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, exadbVmClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExascaleDbNodeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDbNodeListResult.DeserializeExascaleDbNodeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExascaleDbNode resources by ExadbVmCluster. + /// 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 name of the ExadbVmCluster. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string exadbVmClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exadbVmClusterName, nameof(exadbVmClusterName)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, exadbVmClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExascaleDbNodeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDbNodeListResult.DeserializeExascaleDbNodeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbStorageVaultsRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbStorageVaultsRestOperations.cs new file mode 100644 index 000000000000..cf0d29fc3dc5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/ExascaleDbStorageVaultsRestOperations.cs @@ -0,0 +1,723 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class ExascaleDbStorageVaultsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ExascaleDbStorageVaultsRestOperations. + /// 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 ExascaleDbStorageVaultsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string exascaleDbStorageVaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDbStorageVaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string exascaleDbStorageVaultName) + { + 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/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDbStorageVaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// 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 exascaleDbStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, exascaleDbStorageVaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExascaleDbStorageVaultData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDbStorageVaultData.DeserializeExascaleDbStorageVaultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExascaleDbStorageVaultData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// 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 exascaleDbStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, exascaleDbStorageVaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExascaleDbStorageVaultData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDbStorageVaultData.DeserializeExascaleDbStorageVaultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExascaleDbStorageVaultData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string exascaleDbStorageVaultName, ExascaleDbStorageVaultData 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/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDbStorageVaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string exascaleDbStorageVaultName, ExascaleDbStorageVaultData 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/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDbStorageVaultName, 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 ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// Resource create parameters. + /// 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 exascaleDbStorageVaultName, ExascaleDbStorageVaultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, exascaleDbStorageVaultName, 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); + } + } + + /// Create a ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// Resource create parameters. + /// 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 exascaleDbStorageVaultName, ExascaleDbStorageVaultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, exascaleDbStorageVaultName, 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 exascaleDbStorageVaultName, ExascaleDbStorageVaultPatch 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/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDbStorageVaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string exascaleDbStorageVaultName, ExascaleDbStorageVaultPatch 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/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDbStorageVaultName, 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; + } + + /// Update a ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// The resource properties to be updated. + /// 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 exascaleDbStorageVaultName, ExascaleDbStorageVaultPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, exascaleDbStorageVaultName, 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); + } + } + + /// Update a ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// The resource properties to be updated. + /// 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 exascaleDbStorageVaultName, ExascaleDbStorageVaultPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, exascaleDbStorageVaultName, 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 exascaleDbStorageVaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDbStorageVaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string exascaleDbStorageVaultName) + { + 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/Oracle.Database/exascaleDbStorageVaults/", false); + uri.AppendPath(exascaleDbStorageVaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// 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 exascaleDbStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, exascaleDbStorageVaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a ExascaleDbStorageVault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the ExascaleDbStorageVault. + /// 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 exascaleDbStorageVaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(exascaleDbStorageVaultName, nameof(exascaleDbStorageVaultName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, exascaleDbStorageVaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exascaleDbStorageVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/exascaleDbStorageVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExascaleDbStorageVault resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExascaleDbStorageVaultListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDbStorageVaultListResult.DeserializeExascaleDbStorageVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExascaleDbStorageVault resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExascaleDbStorageVaultListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDbStorageVaultListResult.DeserializeExascaleDbStorageVaultListResult(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/Oracle.Database/exascaleDbStorageVaults", 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/Oracle.Database/exascaleDbStorageVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExascaleDbStorageVault resources by subscription ID. + /// 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: + { + ExascaleDbStorageVaultListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDbStorageVaultListResult.DeserializeExascaleDbStorageVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExascaleDbStorageVault resources by subscription ID. + /// 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: + { + ExascaleDbStorageVaultListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDbStorageVaultListResult.DeserializeExascaleDbStorageVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List ExascaleDbStorageVault resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExascaleDbStorageVaultListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDbStorageVaultListResult.DeserializeExascaleDbStorageVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExascaleDbStorageVault resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExascaleDbStorageVaultListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDbStorageVaultListResult.DeserializeExascaleDbStorageVaultListResult(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; + } + + /// List ExascaleDbStorageVault resources by subscription ID. + /// 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: + { + ExascaleDbStorageVaultListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExascaleDbStorageVaultListResult.DeserializeExascaleDbStorageVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List ExascaleDbStorageVault resources by subscription ID. + /// 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: + { + ExascaleDbStorageVaultListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExascaleDbStorageVaultListResult.DeserializeExascaleDbStorageVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/FlexComponentsRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/FlexComponentsRestOperations.cs new file mode 100644 index 000000000000..9a76b2e91f5f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/FlexComponentsRestOperations.cs @@ -0,0 +1,307 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class FlexComponentsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FlexComponentsRestOperations. + /// 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 FlexComponentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string flexComponentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/flexComponents/", false); + uri.AppendPath(flexComponentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string flexComponentName) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/flexComponents/", false); + uri.AppendPath(flexComponentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a FlexComponent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The name of the FlexComponent. + /// 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, AzureLocation location, string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var message = CreateGetRequest(subscriptionId, location, flexComponentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FlexComponentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FlexComponentData.DeserializeFlexComponentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FlexComponentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a FlexComponent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The name of the FlexComponent. + /// 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, AzureLocation location, string flexComponentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(flexComponentName, nameof(flexComponentName)); + + using var message = CreateGetRequest(subscriptionId, location, flexComponentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FlexComponentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FlexComponentData.DeserializeFlexComponentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FlexComponentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, AzureLocation location, SystemShape? shape) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/flexComponents", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (shape != null) + { + uri.AppendQuery("shape", shape.Value.ToString(), true); + } + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, AzureLocation location, SystemShape? shape) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/flexComponents", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (shape != null) + { + uri.AppendQuery("shape", shape.Value.ToString(), true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List FlexComponent resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByParentAsync(string subscriptionId, AzureLocation location, SystemShape? shape = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByParentRequest(subscriptionId, location, shape); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FlexComponentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FlexComponentListResult.DeserializeFlexComponentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FlexComponent resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByParent(string subscriptionId, AzureLocation location, SystemShape? shape = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByParentRequest(subscriptionId, location, shape); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FlexComponentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FlexComponentListResult.DeserializeFlexComponentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List FlexComponent resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, location, shape); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FlexComponentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FlexComponentListResult.DeserializeFlexComponentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List FlexComponent resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByParentNextPage(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, location, shape); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FlexComponentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FlexComponentListResult.DeserializeFlexComponentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiMinorVersionsRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiMinorVersionsRestOperations.cs new file mode 100644 index 000000000000..b75755f7b65e --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiMinorVersionsRestOperations.cs @@ -0,0 +1,339 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class GiMinorVersionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of GiMinorVersionsRestOperations. + /// 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 GiMinorVersionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily, string zone) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/giVersions/", false); + uri.AppendPath(giversionname, true); + uri.AppendPath("/giMinorVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (shapeFamily != null) + { + uri.AppendQuery("shapeFamily", shapeFamily.Value.ToString(), true); + } + if (zone != null) + { + uri.AppendQuery("zone", zone, true); + } + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily, string zone) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/giVersions/", false); + uri.AppendPath(giversionname, true); + uri.AppendPath("/giMinorVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (shapeFamily != null) + { + uri.AppendQuery("shapeFamily", shapeFamily.Value.ToString(), true); + } + if (zone != null) + { + uri.AppendQuery("zone", zone, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List GiMinorVersion resources by GiVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// GiVersion name. + /// If provided, filters the results to the set of database versions which are supported for the given shape family. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByParentAsync(string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily = null, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var message = CreateListByParentRequest(subscriptionId, location, giversionname, shapeFamily, zone); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GiMinorVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GiMinorVersionListResult.DeserializeGiMinorVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List GiMinorVersion resources by GiVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// GiVersion name. + /// If provided, filters the results to the set of database versions which are supported for the given shape family. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByParent(string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily = null, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var message = CreateListByParentRequest(subscriptionId, location, giversionname, shapeFamily, zone); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GiMinorVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GiMinorVersionListResult.DeserializeGiMinorVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string giversionname, string giMinorVersionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/giVersions/", false); + uri.AppendPath(giversionname, true); + uri.AppendPath("/giMinorVersions/", false); + uri.AppendPath(giMinorVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string giversionname, string giMinorVersionName) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/giVersions/", false); + uri.AppendPath(giversionname, true); + uri.AppendPath("/giMinorVersions/", false); + uri.AppendPath(giMinorVersionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a GiMinorVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// GiVersion name. + /// The name of the GiMinorVersion. + /// 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, AzureLocation location, string giversionname, string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var message = CreateGetRequest(subscriptionId, location, giversionname, giMinorVersionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GiMinorVersionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GiMinorVersionData.DeserializeGiMinorVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GiMinorVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a GiMinorVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// GiVersion name. + /// The name of the GiMinorVersion. + /// 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, AzureLocation location, string giversionname, string giMinorVersionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + Argument.AssertNotNullOrEmpty(giMinorVersionName, nameof(giMinorVersionName)); + + using var message = CreateGetRequest(subscriptionId, location, giversionname, giMinorVersionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GiMinorVersionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GiMinorVersionData.DeserializeGiMinorVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GiMinorVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily, string zone) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily, string zone) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List GiMinorVersion resources by GiVersion. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// GiVersion name. + /// If provided, filters the results to the set of database versions which are supported for the given shape family. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily = null, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, location, giversionname, shapeFamily, zone); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GiMinorVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GiMinorVersionListResult.DeserializeGiMinorVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List GiMinorVersion resources by GiVersion. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// GiVersion name. + /// If provided, filters the results to the set of database versions which are supported for the given shape family. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByParentNextPage(string nextLink, string subscriptionId, AzureLocation location, string giversionname, ShapeFamily? shapeFamily = null, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, location, giversionname, shapeFamily, zone); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GiMinorVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GiMinorVersionListResult.DeserializeGiMinorVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiVersionsRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiVersionsRestOperations.cs new file mode 100644 index 000000000000..d1ad8b1391cc --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/GiVersionsRestOperations.cs @@ -0,0 +1,319 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class GiVersionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of GiVersionsRestOperations. + /// 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 GiVersionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string giversionname) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/giVersions/", false); + uri.AppendPath(giversionname, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string giversionname) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/giVersions/", false); + uri.AppendPath(giversionname, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a GiVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// GiVersion 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, AzureLocation location, string giversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var message = CreateGetRequest(subscriptionId, location, giversionname); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GiVersionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GiVersionData.DeserializeGiVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GiVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a GiVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// GiVersion 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, AzureLocation location, string giversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(giversionname, nameof(giversionname)); + + using var message = CreateGetRequest(subscriptionId, location, giversionname); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GiVersionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GiVersionData.DeserializeGiVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GiVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationRequestUri(string subscriptionId, AzureLocation location, SystemShape? shape, string zone) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/giVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (shape != null) + { + uri.AppendQuery("shape", shape.Value.ToString(), true); + } + if (zone != null) + { + uri.AppendQuery("zone", zone, true); + } + return uri; + } + + internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLocation location, SystemShape? shape, string zone) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/giVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (shape != null) + { + uri.AppendQuery("shape", shape.Value.ToString(), true); + } + if (zone != null) + { + uri.AppendQuery("zone", zone, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List GiVersion resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationAsync(string subscriptionId, AzureLocation location, SystemShape? shape = null, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location, shape, zone); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GiVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GiVersionListResult.DeserializeGiVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List GiVersion resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocation(string subscriptionId, AzureLocation location, SystemShape? shape = null, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location, shape, zone); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GiVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GiVersionListResult.DeserializeGiVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape, string zone) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape, string zone) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List GiVersion resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape = null, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location, shape, zone); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + GiVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = GiVersionListResult.DeserializeGiVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List GiVersion resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// If provided, filters the results for the given shape. + /// Filters the result for the given Azure Availability Zone. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocationNextPage(string nextLink, string subscriptionId, AzureLocation location, SystemShape? shape = null, string zone = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location, shape, zone); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + GiVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = GiVersionListResult.DeserializeGiVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/OracleSubscriptionsRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/OracleSubscriptionsRestOperations.cs new file mode 100644 index 000000000000..c637c890d617 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/OracleSubscriptionsRestOperations.cs @@ -0,0 +1,787 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class OracleSubscriptionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of OracleSubscriptionsRestOperations. + /// 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 OracleSubscriptionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/oracleSubscriptions", 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/Oracle.Database/oracleSubscriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List OracleSubscription resources by subscription ID. + /// 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: + { + OracleSubscriptionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OracleSubscriptionListResult.DeserializeOracleSubscriptionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List OracleSubscription resources by subscription ID. + /// 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: + { + OracleSubscriptionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OracleSubscriptionListResult.DeserializeOracleSubscriptionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, OracleSubscriptionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/oracleSubscriptions/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, OracleSubscriptionData 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("/providers/Oracle.Database/oracleSubscriptions/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a OracleSubscription. + /// The ID of the target subscription. The value must be an UUID. + /// Resource create parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, OracleSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, 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); + } + } + + /// Create a OracleSubscription. + /// The ID of the target subscription. The value must be an UUID. + /// Resource create parameters. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, OracleSubscriptionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/oracleSubscriptions/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(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/Oracle.Database/oracleSubscriptions/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a OracleSubscription. + /// 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> GetAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateGetRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OracleSubscriptionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OracleSubscriptionData.DeserializeOracleSubscriptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((OracleSubscriptionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a OracleSubscription. + /// 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 Get(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateGetRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OracleSubscriptionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OracleSubscriptionData.DeserializeOracleSubscriptionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((OracleSubscriptionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, OracleSubscriptionPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/oracleSubscriptions/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, OracleSubscriptionPatch 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("/providers/Oracle.Database/oracleSubscriptions/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a OracleSubscription. + /// The ID of the target subscription. The value must be an UUID. + /// The resource properties to be updated. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, OracleSubscriptionPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, 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); + } + } + + /// Update a OracleSubscription. + /// The ID of the target subscription. The value must be an UUID. + /// The resource properties to be updated. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, OracleSubscriptionPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, 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) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/oracleSubscriptions/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId) + { + 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("/providers/Oracle.Database/oracleSubscriptions/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a OracleSubscription. + /// 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 DeleteAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateDeleteRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a OracleSubscription. + /// 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 Delete(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateDeleteRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListCloudAccountDetailsRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/oracleSubscriptions/default/listCloudAccountDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListCloudAccountDetailsRequest(string subscriptionId) + { + 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/Oracle.Database/oracleSubscriptions/default/listCloudAccountDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Cloud Account Details. + /// 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 ListCloudAccountDetailsAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListCloudAccountDetailsRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Cloud Account Details. + /// 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 ListCloudAccountDetails(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListCloudAccountDetailsRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListSaasSubscriptionDetailsRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/oracleSubscriptions/default/listSaasSubscriptionDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListSaasSubscriptionDetailsRequest(string subscriptionId) + { + 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/Oracle.Database/oracleSubscriptions/default/listSaasSubscriptionDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Saas Subscription Details. + /// 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 ListSaasSubscriptionDetailsAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListSaasSubscriptionDetailsRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Saas Subscription Details. + /// 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 ListSaasSubscriptionDetails(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListSaasSubscriptionDetailsRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListActivationLinksRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/oracleSubscriptions/default/listActivationLinks", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListActivationLinksRequest(string subscriptionId) + { + 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/Oracle.Database/oracleSubscriptions/default/listActivationLinks", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Activation Links. + /// 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 ListActivationLinksAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListActivationLinksRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Activation Links. + /// 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 ListActivationLinks(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListActivationLinksRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateAddAzureSubscriptionsRequestUri(string subscriptionId, AzureSubscriptions body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/oracleSubscriptions/default/addAzureSubscriptions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateAddAzureSubscriptionsRequest(string subscriptionId, AzureSubscriptions body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/oracleSubscriptions/default/addAzureSubscriptions", 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; + } + + /// Add Azure Subscriptions. + /// The ID of the target subscription. The value must be an UUID. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task AddAzureSubscriptionsAsync(string subscriptionId, AzureSubscriptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateAddAzureSubscriptionsRequest(subscriptionId, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Add Azure Subscriptions. + /// The ID of the target subscription. The value must be an UUID. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response AddAzureSubscriptions(string subscriptionId, AzureSubscriptions body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateAddAzureSubscriptionsRequest(subscriptionId, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return 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; + } + + /// List OracleSubscription resources by subscription ID. + /// 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: + { + OracleSubscriptionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OracleSubscriptionListResult.DeserializeOracleSubscriptionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List OracleSubscription resources by subscription ID. + /// 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: + { + OracleSubscriptionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OracleSubscriptionListResult.DeserializeOracleSubscriptionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/SystemVersionsRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/SystemVersionsRestOperations.cs new file mode 100644 index 000000000000..2edd20323817 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/SystemVersionsRestOperations.cs @@ -0,0 +1,295 @@ +// 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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class SystemVersionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SystemVersionsRestOperations. + /// 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 SystemVersionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string systemversionname) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/systemVersions/", false); + uri.AppendPath(systemversionname, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string systemversionname) + { + 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/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/systemVersions/", false); + uri.AppendPath(systemversionname, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a SystemVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// SystemVersion 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, AzureLocation location, string systemversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(systemversionname, nameof(systemversionname)); + + using var message = CreateGetRequest(subscriptionId, location, systemversionname); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SystemVersionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SystemVersionData.DeserializeSystemVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SystemVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a SystemVersion. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// SystemVersion 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, AzureLocation location, string systemversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(systemversionname, nameof(systemversionname)); + + using var message = CreateGetRequest(subscriptionId, location, systemversionname); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SystemVersionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SystemVersionData.DeserializeSystemVersionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SystemVersionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationRequestUri(string subscriptionId, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/systemVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByLocationRequest(string subscriptionId, AzureLocation location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Oracle.Database/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/systemVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SystemVersion resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SystemVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SystemVersionListResult.DeserializeSystemVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SystemVersion resources by SubscriptionLocationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocation(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationRequest(subscriptionId, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SystemVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SystemVersionListResult.DeserializeSystemVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByLocationNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByLocationNextPageRequest(string nextLink, string subscriptionId, AzureLocation location) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SystemVersion resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListByLocationNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SystemVersionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SystemVersionListResult.DeserializeSystemVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SystemVersion resources by SubscriptionLocationResource. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListByLocationNextPage(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListByLocationNextPageRequest(nextLink, subscriptionId, location); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SystemVersionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SystemVersionListResult.DeserializeSystemVersionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/VirtualNetworkAddressesRestOperations.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/VirtualNetworkAddressesRestOperations.cs new file mode 100644 index 000000000000..a31bf43aeec2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/RestOperations/VirtualNetworkAddressesRestOperations.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + internal partial class VirtualNetworkAddressesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of VirtualNetworkAddressesRestOperations. + /// 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 VirtualNetworkAddressesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-03-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername, string virtualnetworkaddressname, VirtualNetworkAddressData 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/virtualNetworkAddresses/", false); + uri.AppendPath(virtualnetworkaddressname, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername, string virtualnetworkaddressname, VirtualNetworkAddressData 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/virtualNetworkAddresses/", false); + uri.AppendPath(virtualnetworkaddressname, 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 VirtualNetworkAddress. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// Virtual IP address hostname. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string cloudvmclustername, string virtualnetworkaddressname, VirtualNetworkAddressData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNullOrEmpty(virtualnetworkaddressname, nameof(virtualnetworkaddressname)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, cloudvmclustername, virtualnetworkaddressname, 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); + } + } + + /// Create a VirtualNetworkAddress. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// Virtual IP address hostname. + /// Resource create parameters. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string cloudvmclustername, string virtualnetworkaddressname, VirtualNetworkAddressData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNullOrEmpty(virtualnetworkaddressname, nameof(virtualnetworkaddressname)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, cloudvmclustername, virtualnetworkaddressname, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername, string virtualnetworkaddressname) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/virtualNetworkAddresses/", false); + uri.AppendPath(virtualnetworkaddressname, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername, string virtualnetworkaddressname) + { + 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/virtualNetworkAddresses/", false); + uri.AppendPath(virtualnetworkaddressname, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a VirtualNetworkAddress. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// Virtual IP address hostname. + /// 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 cloudvmclustername, string virtualnetworkaddressname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNullOrEmpty(virtualnetworkaddressname, nameof(virtualnetworkaddressname)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, cloudvmclustername, virtualnetworkaddressname); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VirtualNetworkAddressData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = VirtualNetworkAddressData.DeserializeVirtualNetworkAddressData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VirtualNetworkAddressData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a VirtualNetworkAddress. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// Virtual IP address hostname. + /// 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 cloudvmclustername, string virtualnetworkaddressname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNullOrEmpty(virtualnetworkaddressname, nameof(virtualnetworkaddressname)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, cloudvmclustername, virtualnetworkaddressname); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VirtualNetworkAddressData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = VirtualNetworkAddressData.DeserializeVirtualNetworkAddressData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((VirtualNetworkAddressData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername, string virtualnetworkaddressname) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/virtualNetworkAddresses/", false); + uri.AppendPath(virtualnetworkaddressname, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername, string virtualnetworkaddressname) + { + 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/virtualNetworkAddresses/", false); + uri.AppendPath(virtualnetworkaddressname, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a VirtualNetworkAddress. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// Virtual IP address hostname. + /// 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 cloudvmclustername, string virtualnetworkaddressname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNullOrEmpty(virtualnetworkaddressname, nameof(virtualnetworkaddressname)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, cloudvmclustername, virtualnetworkaddressname); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a VirtualNetworkAddress. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// Virtual IP address hostname. + /// 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 cloudvmclustername, string virtualnetworkaddressname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + Argument.AssertNotNullOrEmpty(virtualnetworkaddressname, nameof(virtualnetworkaddressname)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, cloudvmclustername, virtualnetworkaddressname); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string cloudvmclustername) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/virtualNetworkAddresses", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string cloudvmclustername) + { + 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/Oracle.Database/cloudVmClusters/", false); + uri.AppendPath(cloudvmclustername, true); + uri.AppendPath("/virtualNetworkAddresses", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List VirtualNetworkAddress resources by CloudVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentAsync(string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, cloudvmclustername); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VirtualNetworkAddressListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = VirtualNetworkAddressListResult.DeserializeVirtualNetworkAddressListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List VirtualNetworkAddress resources by CloudVmCluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// CloudVmCluster name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParent(string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, cloudvmclustername); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VirtualNetworkAddressListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = VirtualNetworkAddressListResult.DeserializeVirtualNetworkAddressListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List VirtualNetworkAddress resources by CloudVmCluster. + /// 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. + /// CloudVmCluster name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByParentNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudvmclustername); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VirtualNetworkAddressListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = VirtualNetworkAddressListResult.DeserializeVirtualNetworkAddressListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List VirtualNetworkAddress resources by CloudVmCluster. + /// 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. + /// CloudVmCluster name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByParentNextPage(string nextLink, string subscriptionId, string resourceGroupName, string cloudvmclustername, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(cloudvmclustername, nameof(cloudvmclustername)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudvmclustername); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VirtualNetworkAddressListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = VirtualNetworkAddressListResult.DeserializeVirtualNetworkAddressListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionCollection.cs new file mode 100644 index 000000000000..cec05e331a7a --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionCollection.cs @@ -0,0 +1,399 @@ +// 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.OracleDatabase +{ + /// + /// 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 GetSystemVersions method from an instance of . + /// + public partial class SystemVersionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _systemVersionClientDiagnostics; + private readonly SystemVersionsRestOperations _systemVersionRestClient; + private readonly AzureLocation _location; + + /// Initializes a new instance of the class for mocking. + protected SystemVersionCollection() + { + } + + /// 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. + /// The name of the Azure region. + internal SystemVersionCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) + { + _location = location; + _systemVersionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", SystemVersionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SystemVersionResource.ResourceType, out string systemVersionApiVersion); + _systemVersionRestClient = new SystemVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, systemVersionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Get a SystemVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname} + /// + /// + /// Operation Id + /// SystemVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// SystemVersion 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 systemversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(systemversionname, nameof(systemversionname)); + + using var scope = _systemVersionClientDiagnostics.CreateScope("SystemVersionCollection.Get"); + scope.Start(); + try + { + var response = await _systemVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), systemversionname, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SystemVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SystemVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname} + /// + /// + /// Operation Id + /// SystemVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// SystemVersion name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string systemversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(systemversionname, nameof(systemversionname)); + + using var scope = _systemVersionClientDiagnostics.CreateScope("SystemVersionCollection.Get"); + scope.Start(); + try + { + var response = _systemVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), systemversionname, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SystemVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List SystemVersion resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions + /// + /// + /// Operation Id + /// SystemVersion_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-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) => _systemVersionRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _systemVersionRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SystemVersionResource(Client, SystemVersionData.DeserializeSystemVersionData(e)), _systemVersionClientDiagnostics, Pipeline, "SystemVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List SystemVersion resources by SubscriptionLocationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions + /// + /// + /// Operation Id + /// SystemVersion_ListByLocation + /// + /// + /// Default Api Version + /// 2025-03-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) => _systemVersionRestClient.CreateListByLocationRequest(Id.SubscriptionId, new AzureLocation(_location)); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _systemVersionRestClient.CreateListByLocationNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location)); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SystemVersionResource(Client, SystemVersionData.DeserializeSystemVersionData(e)), _systemVersionClientDiagnostics, Pipeline, "SystemVersionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname} + /// + /// + /// Operation Id + /// SystemVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// SystemVersion 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 systemversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(systemversionname, nameof(systemversionname)); + + using var scope = _systemVersionClientDiagnostics.CreateScope("SystemVersionCollection.Exists"); + scope.Start(); + try + { + var response = await _systemVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), systemversionname, 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}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname} + /// + /// + /// Operation Id + /// SystemVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// SystemVersion name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string systemversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(systemversionname, nameof(systemversionname)); + + using var scope = _systemVersionClientDiagnostics.CreateScope("SystemVersionCollection.Exists"); + scope.Start(); + try + { + var response = _systemVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), systemversionname, 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}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname} + /// + /// + /// Operation Id + /// SystemVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// SystemVersion 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 systemversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(systemversionname, nameof(systemversionname)); + + using var scope = _systemVersionClientDiagnostics.CreateScope("SystemVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _systemVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), systemversionname, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SystemVersionResource(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}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname} + /// + /// + /// Operation Id + /// SystemVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// SystemVersion name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string systemversionname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(systemversionname, nameof(systemversionname)); + + using var scope = _systemVersionClientDiagnostics.CreateScope("SystemVersionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _systemVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), systemversionname, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SystemVersionResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionData.Serialization.cs new file mode 100644 index 000000000000..a383b4755ceb --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class SystemVersionData : 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(SystemVersionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + SystemVersionData 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(SystemVersionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSystemVersionData(document.RootElement, options); + } + + internal static SystemVersionData DeserializeSystemVersionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SystemVersionProperties 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 = SystemVersionProperties.DeserializeSystemVersionProperties(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 SystemVersionData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SystemVersionData)} does not support writing '{options.Format}' format."); + } + } + + SystemVersionData 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 DeserializeSystemVersionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SystemVersionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionData.cs new file mode 100644 index 000000000000..aeb14f7043d2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionData.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; +using Azure.ResourceManager.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the SystemVersion data model. + /// SystemVersion resource Definition + /// + public partial class SystemVersionData : 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 SystemVersionData() + { + } + + /// 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 SystemVersionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SystemVersionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + internal SystemVersionProperties Properties { get; } + /// A valid Oracle System Version. + public string SystemVersion + { + get => Properties?.SystemVersion; + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionResource.Serialization.cs new file mode 100644 index 000000000000..b92fc857d12f --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionResource.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.OracleDatabase +{ + public partial class SystemVersionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SystemVersionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SystemVersionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionResource.cs new file mode 100644 index 000000000000..62c501f48410 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/SystemVersionResource.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; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A Class representing a SystemVersion 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 GetSystemVersionResource method. + /// Otherwise you can get one from its parent resource using the GetSystemVersion method. + /// + public partial class SystemVersionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The location. + /// The systemversionname. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string systemversionname) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _systemVersionClientDiagnostics; + private readonly SystemVersionsRestOperations _systemVersionRestClient; + private readonly SystemVersionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/locations/systemVersions"; + + /// Initializes a new instance of the class for mocking. + protected SystemVersionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SystemVersionResource(ArmClient client, SystemVersionData 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 SystemVersionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _systemVersionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string systemVersionApiVersion); + _systemVersionRestClient = new SystemVersionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, systemVersionApiVersion); +#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 SystemVersionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a SystemVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname} + /// + /// + /// Operation Id + /// SystemVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _systemVersionClientDiagnostics.CreateScope("SystemVersionResource.Get"); + scope.Start(); + try + { + var response = await _systemVersionRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SystemVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SystemVersion + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Oracle.Database/locations/{location}/systemVersions/{systemversionname} + /// + /// + /// Operation Id + /// SystemVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _systemVersionClientDiagnostics.CreateScope("SystemVersionResource.Get"); + scope.Start(); + try + { + var response = _systemVersionRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SystemVersionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressCollection.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressCollection.cs new file mode 100644 index 000000000000..45cfd01cc58b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressCollection.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.OracleDatabase +{ + /// + /// 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 GetVirtualNetworkAddresses method from an instance of . + /// + public partial class VirtualNetworkAddressCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _virtualNetworkAddressClientDiagnostics; + private readonly VirtualNetworkAddressesRestOperations _virtualNetworkAddressRestClient; + + /// Initializes a new instance of the class for mocking. + protected VirtualNetworkAddressCollection() + { + } + + /// 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 VirtualNetworkAddressCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _virtualNetworkAddressClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", VirtualNetworkAddressResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(VirtualNetworkAddressResource.ResourceType, out string virtualNetworkAddressApiVersion); + _virtualNetworkAddressRestClient = new VirtualNetworkAddressesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, virtualNetworkAddressApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CloudVmClusterResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CloudVmClusterResource.ResourceType), nameof(id)); + } + + /// + /// Create a VirtualNetworkAddress + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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. + /// Virtual IP address hostname. + /// Resource create parameters. + /// 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 virtualnetworkaddressname, VirtualNetworkAddressData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(virtualnetworkaddressname, nameof(virtualnetworkaddressname)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _virtualNetworkAddressClientDiagnostics.CreateScope("VirtualNetworkAddressCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _virtualNetworkAddressRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, virtualnetworkaddressname, data, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new VirtualNetworkAddressOperationSource(Client), _virtualNetworkAddressClientDiagnostics, Pipeline, _virtualNetworkAddressRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, virtualnetworkaddressname, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a VirtualNetworkAddress + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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. + /// Virtual IP address hostname. + /// Resource create parameters. + /// 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 virtualnetworkaddressname, VirtualNetworkAddressData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(virtualnetworkaddressname, nameof(virtualnetworkaddressname)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _virtualNetworkAddressClientDiagnostics.CreateScope("VirtualNetworkAddressCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _virtualNetworkAddressRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, virtualnetworkaddressname, data, cancellationToken); + var operation = new OracleDatabaseArmOperation(new VirtualNetworkAddressOperationSource(Client), _virtualNetworkAddressClientDiagnostics, Pipeline, _virtualNetworkAddressRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, virtualnetworkaddressname, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a VirtualNetworkAddress + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Virtual IP address hostname. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string virtualnetworkaddressname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(virtualnetworkaddressname, nameof(virtualnetworkaddressname)); + + using var scope = _virtualNetworkAddressClientDiagnostics.CreateScope("VirtualNetworkAddressCollection.Get"); + scope.Start(); + try + { + var response = await _virtualNetworkAddressRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, virtualnetworkaddressname, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VirtualNetworkAddressResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a VirtualNetworkAddress + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Virtual IP address hostname. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string virtualnetworkaddressname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(virtualnetworkaddressname, nameof(virtualnetworkaddressname)); + + using var scope = _virtualNetworkAddressClientDiagnostics.CreateScope("VirtualNetworkAddressCollection.Get"); + scope.Start(); + try + { + var response = _virtualNetworkAddressRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, virtualnetworkaddressname, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VirtualNetworkAddressResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List VirtualNetworkAddress resources by CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses + /// + /// + /// Operation Id + /// VirtualNetworkAddress_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-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) => _virtualNetworkAddressRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _virtualNetworkAddressRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new VirtualNetworkAddressResource(Client, VirtualNetworkAddressData.DeserializeVirtualNetworkAddressData(e)), _virtualNetworkAddressClientDiagnostics, Pipeline, "VirtualNetworkAddressCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List VirtualNetworkAddress resources by CloudVmCluster + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses + /// + /// + /// Operation Id + /// VirtualNetworkAddress_ListByParent + /// + /// + /// Default Api Version + /// 2025-03-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) => _virtualNetworkAddressRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _virtualNetworkAddressRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new VirtualNetworkAddressResource(Client, VirtualNetworkAddressData.DeserializeVirtualNetworkAddressData(e)), _virtualNetworkAddressClientDiagnostics, Pipeline, "VirtualNetworkAddressCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Virtual IP address hostname. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string virtualnetworkaddressname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(virtualnetworkaddressname, nameof(virtualnetworkaddressname)); + + using var scope = _virtualNetworkAddressClientDiagnostics.CreateScope("VirtualNetworkAddressCollection.Exists"); + scope.Start(); + try + { + var response = await _virtualNetworkAddressRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, virtualnetworkaddressname, 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/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Virtual IP address hostname. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string virtualnetworkaddressname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(virtualnetworkaddressname, nameof(virtualnetworkaddressname)); + + using var scope = _virtualNetworkAddressClientDiagnostics.CreateScope("VirtualNetworkAddressCollection.Exists"); + scope.Start(); + try + { + var response = _virtualNetworkAddressRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, virtualnetworkaddressname, 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/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Virtual IP address hostname. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string virtualnetworkaddressname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(virtualnetworkaddressname, nameof(virtualnetworkaddressname)); + + using var scope = _virtualNetworkAddressClientDiagnostics.CreateScope("VirtualNetworkAddressCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _virtualNetworkAddressRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, virtualnetworkaddressname, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new VirtualNetworkAddressResource(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/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Virtual IP address hostname. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string virtualnetworkaddressname, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(virtualnetworkaddressname, nameof(virtualnetworkaddressname)); + + using var scope = _virtualNetworkAddressClientDiagnostics.CreateScope("VirtualNetworkAddressCollection.GetIfExists"); + scope.Start(); + try + { + var response = _virtualNetworkAddressRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, virtualnetworkaddressname, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new VirtualNetworkAddressResource(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressData.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressData.Serialization.cs new file mode 100644 index 000000000000..5a2f37ca80ca --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + public partial class VirtualNetworkAddressData : 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(VirtualNetworkAddressData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + VirtualNetworkAddressData 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(VirtualNetworkAddressData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVirtualNetworkAddressData(document.RootElement, options); + } + + internal static VirtualNetworkAddressData DeserializeVirtualNetworkAddressData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + VirtualNetworkAddressProperties 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 = VirtualNetworkAddressProperties.DeserializeVirtualNetworkAddressProperties(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 VirtualNetworkAddressData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VirtualNetworkAddressData)} does not support writing '{options.Format}' format."); + } + } + + VirtualNetworkAddressData 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 DeserializeVirtualNetworkAddressData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VirtualNetworkAddressData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressData.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressData.cs new file mode 100644 index 000000000000..519b00ad62ca --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressData.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.OracleDatabase.Models; + +namespace Azure.ResourceManager.OracleDatabase +{ + /// + /// A class representing the VirtualNetworkAddress data model. + /// Virtual IP resource belonging to a vm cluster resource. + /// + public partial class VirtualNetworkAddressData : 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 VirtualNetworkAddressData() + { + } + + /// 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 VirtualNetworkAddressData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, VirtualNetworkAddressProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public VirtualNetworkAddressProperties Properties { get; set; } + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressResource.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressResource.Serialization.cs new file mode 100644 index 000000000000..fee7a89ea94d --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressResource.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.OracleDatabase +{ + public partial class VirtualNetworkAddressResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + VirtualNetworkAddressData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + VirtualNetworkAddressData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressResource.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressResource.cs new file mode 100644 index 000000000000..9a49dc568427 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/VirtualNetworkAddressResource.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.OracleDatabase +{ + /// + /// A Class representing a VirtualNetworkAddress 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 GetVirtualNetworkAddressResource method. + /// Otherwise you can get one from its parent resource using the GetVirtualNetworkAddress method. + /// + public partial class VirtualNetworkAddressResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The cloudvmclustername. + /// The virtualnetworkaddressname. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string cloudvmclustername, string virtualnetworkaddressname) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _virtualNetworkAddressClientDiagnostics; + private readonly VirtualNetworkAddressesRestOperations _virtualNetworkAddressRestClient; + private readonly VirtualNetworkAddressData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Oracle.Database/cloudVmClusters/virtualNetworkAddresses"; + + /// Initializes a new instance of the class for mocking. + protected VirtualNetworkAddressResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal VirtualNetworkAddressResource(ArmClient client, VirtualNetworkAddressData 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 VirtualNetworkAddressResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _virtualNetworkAddressClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.OracleDatabase", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string virtualNetworkAddressApiVersion); + _virtualNetworkAddressRestClient = new VirtualNetworkAddressesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, virtualNetworkAddressApiVersion); +#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 VirtualNetworkAddressData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a VirtualNetworkAddress + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _virtualNetworkAddressClientDiagnostics.CreateScope("VirtualNetworkAddressResource.Get"); + scope.Start(); + try + { + var response = await _virtualNetworkAddressRestClient.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 VirtualNetworkAddressResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a VirtualNetworkAddress + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _virtualNetworkAddressClientDiagnostics.CreateScope("VirtualNetworkAddressResource.Get"); + scope.Start(); + try + { + var response = _virtualNetworkAddressRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new VirtualNetworkAddressResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a VirtualNetworkAddress + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _virtualNetworkAddressClientDiagnostics.CreateScope("VirtualNetworkAddressResource.Delete"); + scope.Start(); + try + { + var response = await _virtualNetworkAddressRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(_virtualNetworkAddressClientDiagnostics, Pipeline, _virtualNetworkAddressRestClient.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; + } + } + + /// + /// Delete a VirtualNetworkAddress + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_Delete + /// + /// + /// Default Api Version + /// 2025-03-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 = _virtualNetworkAddressClientDiagnostics.CreateScope("VirtualNetworkAddressResource.Delete"); + scope.Start(); + try + { + var response = _virtualNetworkAddressRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new OracleDatabaseArmOperation(_virtualNetworkAddressClientDiagnostics, Pipeline, _virtualNetworkAddressRestClient.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 VirtualNetworkAddress + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, VirtualNetworkAddressData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _virtualNetworkAddressClientDiagnostics.CreateScope("VirtualNetworkAddressResource.Update"); + scope.Start(); + try + { + var response = await _virtualNetworkAddressRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new OracleDatabaseArmOperation(new VirtualNetworkAddressOperationSource(Client), _virtualNetworkAddressClientDiagnostics, Pipeline, _virtualNetworkAddressRestClient.CreateCreateOrUpdateRequest(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; + } + } + + /// + /// Create a VirtualNetworkAddress + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Oracle.Database/cloudVmClusters/{cloudvmclustername}/virtualNetworkAddresses/{virtualnetworkaddressname} + /// + /// + /// Operation Id + /// VirtualNetworkAddress_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-03-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. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, VirtualNetworkAddressData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _virtualNetworkAddressClientDiagnostics.CreateScope("VirtualNetworkAddressResource.Update"); + scope.Start(); + try + { + var response = _virtualNetworkAddressRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new OracleDatabaseArmOperation(new VirtualNetworkAddressOperationSource(Client), _virtualNetworkAddressClientDiagnostics, Pipeline, _virtualNetworkAddressRestClient.CreateCreateOrUpdateRequest(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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Properties/AssemblyInfo.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..8175b672ae2b --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/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.OracleDatabase.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("OracleDatabase")] diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tests/Azure.ResourceManager.OracleDatabase.Tests.csproj b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tests/Azure.ResourceManager.OracleDatabase.Tests.csproj new file mode 100644 index 000000000000..84daabbb8df1 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tests/Azure.ResourceManager.OracleDatabase.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tests/OracleDatabaseManagementTestBase.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tests/OracleDatabaseManagementTestBase.cs new file mode 100644 index 000000000000..061bfbffc4be --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tests/OracleDatabaseManagementTestBase.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.OracleDatabase.Tests +{ + public class OracleDatabaseManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected OracleDatabaseManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected OracleDatabaseManagementTestBase(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/oracledatabase/Azure.ResourceManager.OracleDatabase/tests/OracleDatabaseManagementTestEnvironment.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tests/OracleDatabaseManagementTestEnvironment.cs new file mode 100644 index 000000000000..b2cb5d932b65 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tests/OracleDatabaseManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.OracleDatabase.Tests +{ + public class OracleDatabaseManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tsp-location.yaml b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tsp-location.yaml new file mode 100644 index 000000000000..d4abb760a5e7 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/oracle/Oracle.Database.Management +commit: 242acb7e81d1f9bd566eddf04cf16779a5b02cea +repo: Azure/azure-rest-api-specs +additionalDirectories: +- specification/oracle/Oracle.Database.Management/models diff --git a/sdk/oracledatabase/ci.mgmt.yml b/sdk/oracledatabase/ci.mgmt.yml new file mode 100644 index 000000000000..17fa8bd165a0 --- /dev/null +++ b/sdk/oracledatabase/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/oracledatabase /ci.mgmt.yml + - sdk/oracledatabase /Azure.ResourceManager.OracleDatabase / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: oracledatabase + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.OracleDatabase + safeName: AzureResourceManagerOracleDatabase diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 4e3c032f60a4..495f7143d7c7 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -147,6 +147,7 @@ trigger: - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights - sdk/oracle/Azure.ResourceManager.OracleDatabase + - sdk/oracledatabase/Azure.ResourceManager.OracleDatabase - sdk/orbital/Azure.ResourceManager.Orbital - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw - sdk/peering/Azure.ResourceManager.Peering @@ -356,6 +357,7 @@ pr: - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights - sdk/oracle/Azure.ResourceManager.OracleDatabase + - sdk/oracledatabase/Azure.ResourceManager.OracleDatabase - sdk/orbital/Azure.ResourceManager.Orbital - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw - sdk/peering/Azure.ResourceManager.Peering 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/